This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: clock_settime() help


Perhaps you should use cyg_libc_time_settime() instead.  I have not had any
problems using this to set the system time of day.  This does require a
wallclock package to be included in your configuration
(CYGPKG_IO_WALLCLOCK).  You can use the default wallclock emulation device.
Jay

-----Original Message-----
From: Sam Pham [mailto:anhmn@yahoo.com]
Sent: Thursday, October 28, 2004 9:55 AM
To: eCos Discuss
Subject: [ECOS] clock_settime() help


Hi all,

I'm having trouble with calling the clock_settime()
function.  My application has the need of setting the
clock to the current time.  At first, I called
clock_settime() inside my ISR, and then outside of
this ISR, I called clock_gettime() to verify if the
current time was set.  I noticed that sometimes
clock_settime() failed because clock_gettime()
returned a non-current time value.  So I decided to
call clock_settime() in a thread with all interrupts
disabled by calling function cyg_interrupt_disable(). 
However, I still observed the same failure as before.

Could anyone explain to me how I should be using
function clock_settime()?  Its implementation is very
simple - just change the counter value.  However, it
looks like if the kernel is in certain states, then it
won't allow anything to change this counter value.

Thanks.


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]