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


Thanks for your response.  I've found the bug in my SW
that causes clock_settime() to fail at times.  I
didn't normalize the nanosecond field before calling
this function (e.g. if number of nanoseconds >
1000000000, then I need to increment number of seconds
by 1 and decrement number of nanoseconds by
1000000000).


--- sandeep <shimple0@yahoo.com> wrote:

> Sam Pham wrote:
> 
> >>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.
> 
> some very dumb questions -
> 
> - what do you mean by that clock_settime failed??
> - when you say "clock_gettime()returned a
> non-current time value", you mean it 
> returned a value lesser or more than current time?
> - how do you find current time? is your order
>    clock_gettime
>    get current time
>    compare them
> OR
>    get current time
>    clock_gettime
>    compare them
> 
> - if above are your steps, have you tried doing
> these under disabled interrupts 
> and found same results? i am not talking of
> clock_settime with disabled 
> interrupts, here.
> 
> sandeep
> 
> 
> -- 
> Before posting, please read the FAQ:
> http://ecos.sourceware.org/fom/ecos
> and search the list archive:
> http://ecos.sourceware.org/ml/ecos-discuss
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
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]