ts-7000
[Top] [All Lists]

Re: [ts-7000] Re:TS7250 ..RTC

To:
Subject: Re: [ts-7000] Re:TS7250 ..RTC
From: Markus Peuhkuri <>
Date: Wed, 27 Dec 2006 17:33:56 +0200
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/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU