Laks kirjoitti:
> properly every time, will it work in such situation!!
> alternatively can i read the rtc time with a simple function call
Yes, it will. Only you won't be correcting time, but if you can live
with that kind of accuracy, then ok.
> because i had already used similar RTC IC (DS12887) WHERE IN IT IS VERY
> SIMPLE ROUTINE IN ASSEMBLY LANGUAGE to read and write the time and other
> parameters including date month year etc.,
Why you are then running Linux? Of course you can do everything like in
MSDOS era, that is your wasted time. Using standard routines (time or
gettimeofday and localtime or strftime) makes your program portable to
different platforms.
Check Peter Elliot's example on other message (with hard-coded dst
values and other horrors :-). Even that would be much more simple with
stftime:
if (Military)
strftime(stringbuffer, "%H:%M", TimeNow)
else
strftime(stringbuffer, "%I:%M %p", TimeNow)
Standard locales would take care of daylight saving issues and other
formating. Note, that some conversions depend on your local value. You
may want to set locale to 'C' explicitly.
Yes, I do not know how to read RTC clock in assembly, all I need to know
is that hwclock will do that for me: it works the same way on old 368sx
computer, on a new 8-core Xeon, on TS-7250 or on what ever platform you
can run Linux (Debian) on. I guess it works the same way on 2048-core
cluster, but I do not know, because I just use gettimeofday and it works...
--
Markus
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|