avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Missing time.h posix


From: Bob Paddock
Subject: Re: [avr-libc-dev] Missing time.h posix
Date: Sat, 10 Oct 2009 09:02:06 -0400

On Fri, Oct 9, 2009 at 8:39 AM, Daniele Basile <address@hidden> 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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]