[En-Nut-Discussion] systime limit reduces valid uptime to 49 days
Michael Müller
mmueller at cs.uni-kassel.de
Wed Nov 7 11:08:41 CET 2007
Hi Michael,
in addition to my first sent code parts the interrupt function doesn´t
look as if there would be any kind of overflow handling implemented.
(everything based on NutOS 4.4.0)
/*!
* \brief System timer interrupt handler.
*/
#if !(defined (__linux__) || defined(__APPLE__) || defined(__CYGWIN__))
#ifdef USE_TIMER
SIGNAL( SIG_TIMER )
#else
static void NutTimerIntr(void *arg)
#endif
{
nut_ticks++;
// nut_tick_dist[TCNT0]++;
}
#endif
To finally test this phenomenon I wrote a little test program. It first
of all sets the tick counter to one minute before overflow. Then it sets
the time by stime and outputs the time every second:
07.11.2007|07:00:00 tick count: 4294907393
07.11.2007|07:00:01 tick count: 4294908419
07.11.2007|07:00:02 tick count: 4294909445
07.11.2007|07:00:03 tick count: 4294910471
...
07.11.2007|07:00:54 tick count: 4294962797
07.11.2007|07:00:55 tick count: 4294963823
07.11.2007|07:00:56 tick count: 4294964849
07.11.2007|07:00:57 tick count: 4294965875
07.11.2007|07:00:58 tick count: 4294966901
19.09.2007|18:55:55 tick count: 631
19.09.2007|18:55:56 tick count: 1657
19.09.2007|18:55:57 tick count: 2683
19.09.2007|18:55:58 tick count: 3709
19.09.2007|18:55:59 tick count: 4735
19.09.2007|18:56:00 tick count: 5761
...
I can´t explain the date as I expected something far more in the past
but anyway the result is invalid.
Best regards
Michael
Michael Fischer schrieb:
> Hello Michael,
>
> where is the problem that the timer will overflow after 49 days?
> If NutOS use the correct functionality inside to check the timer
> (knowing that an overflow can occur) it should be no problem.
>
> Best regards,
>
> Michael
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
More information about the En-Nut-Discussion
mailing list