Author Topic: Date keeping & routines  (Read 3052 times)

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
Date keeping & routines
« on: November 22, 2009, 12:27:37 AM »
I noticed that the uTasker demo can use a TIME server to get the 32-bit seconds from 0:0:0 1900 time format.  I see that when the TIME server returns the value, it is converted to the present time (by subtracting 9/1/2007, and then 24-h increments).

Are there any routines to use this 32-bit datecode as an actual date?  I do realize that the conversion routines would be significantly more complex (days, months, years, leap year), but I'd like to implement date keeping on-board for data logging purposes.  The system could sync itself to the time server every couple of hours.  I'd prefer a software solution than an external DS1307 type solution.

Regards,
Paul

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Date keeping & routines
« Reply #1 on: November 22, 2009, 01:19:04 AM »
Slight followup: I found the ctime function which looks to do what I need.  It assumes a time in the "UNIX-time" format (seconds relative to 1/1/1970), so I just adjusted the time from the server by 2,208,988,800 s (seconds between 1/1/1900 and 1/1/1970).  This works in the simulator.

HOWEVER, trying to compile this for the LM3S6965 fails.  It looks like any time I try to add any libc functions, the linker attempts to add a section called ".ARM.exidx" at the start of the code, which overlaps with ".vectors".

I'm using CodeSourcery GCC Lite 4.4.1.