This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Wallclock
Rene Nielsen wrote:
Attempted code bloat prevention. It's not meant
to be a general purpose utility function.
Do you have a driver with INIT_GET mode that needs it?
Well, I think we removed the #ifdef in our codebase because Redboot
requires _simple_mkdate() in its default configuration.
We can get around it by setting the CYGSEM_REDBOOT_RTC option to 0, so
that's what we'll do.
No, no need - I was looking for justification, and that's valid justification.
Attached patch committed.
Jifl
--
*See us at Embedded World 2009, Nürnberg, Germany, 3-5 Mar, Stand 11-300*
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/wallclock/current/ChangeLog,v
retrieving revision 1.21
diff -u -5 -p -r1.21 ChangeLog
--- ChangeLog 4 Feb 2009 17:19:40 -0000 1.21
+++ ChangeLog 19 Feb 2009 01:06:59 -0000
@@ -1,5 +1,11 @@
+2009-02-19 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * include/wallclock/wallclock.inl: _simple_mkdate is used by RedBoot
+ and possibly others, so don't make specific to SET_GET mode.
+ (Suggested by Rene Nielsen).
+
2009-02-04 Bart Veer <bartv@ecoscentric.com>
* src/wallclock.cxx: switch to CYG_INIT_DEV_WALLCLOCK init
priority.
Index: include/wallclock/wallclock.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/wallclock/current/include/wallclock/wallclock.inl,v
retrieving revision 1.9
diff -u -5 -p -r1.9 wallclock.inl
--- include/wallclock/wallclock.inl 29 Jan 2009 17:49:49 -0000 1.9
+++ include/wallclock/wallclock.inl 19 Feb 2009 01:06:59 -0000
@@ -9,11 +9,11 @@
//
//==========================================================================
// ####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later
// version.
@@ -99,13 +99,10 @@ _simple_mktime(cyg_uint32 year, cyg_uint
secs = ((days * 24 + hour) * 60 + min) * 60 + sec;
return secs;
}
-#ifdef CYGSEM_WALLCLOCK_SET_GET_MODE
-
-
static void
_simple_mkdate(time_t time,
cyg_uint32* year, cyg_uint32* mon,
cyg_uint32* day, cyg_uint32* hour,
cyg_uint32* min, cyg_uint32* sec)
@@ -133,12 +130,10 @@ _simple_mkdate(time_t time,
*mon = m;
*day = days+1;
}
-#endif
-
//-----------------------------------------------------------------------------
// BCD helper macros
#define TO_BCD(x) ((((x)/10)<<4) | ((x)%10))
#define TO_DEC(x) ((((x)>>4)*10) + ((x)&0xf))