On Fri, Oct 9, 2009 at 8:39 AM, Daniele Basile <aste...@develer.com> wrote:
> we need to use some functions of posix standard time library. We want to use > some time functions that convert unix time to a tm structure, or vice versa, > (ie, mktime, gmtime..), but the avr libc doesn't include them. What is your goal by using these time functions? While simple to use they are not considered safe, MISRA Rule 20.12, nor are they accurate as they rarely handle leap seconds correctly; xx:xx:60. Proper Timezone handling is even unlikely to even fit in the memory space of most smaller AVRs. Checkout the archives of the LeapSecs mailing list: http://six.pairlist.net/mailman/listinfo/leapsecs and the TimeNuts mailing list: http://leapsecond.com/time-nuts.htm to find out how complicated the seeming simple function of tracking Time accurately truly is. LeapSecs deal truly with Time, and frequently GPS time, while TimeNuts deals more with Time and Frequency Standards (These are the people that put Atomic Clocks on their back and hike to the top of mountains to check Relativity). GPS issues are also a frequent topic. I put some simple time structure to seconds/seconds to time structure source code, on my web site at http://www.designer-iii.com/Time . This code is from 1992 and needs converted to modern standards and needs far more validation before it can be used in mission critical applications. Is there any merit to making them part of AVR-LibC? They don't handle timezones, nor leap seconds. Alternatives format to POSIX epic second counting are packed BCD, and packed binary. The book "Embedded Systems Building Blocks" Second Edition or later, by Jean J. Labrosse covers the packed binary format. Books should be on any Embedded Developers bookshelf. -- http://www.wearablesmartsensors.com/ http://www.softwaresafety.net/ http://www.designer-iii.com/ http://www.unusualresearch.com/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev