forked from Imagelibrary/rtems
Fixed problem reported by Victor V. Vengerov <Victor.Vengerov@oktet.ru>
where alarm() did not correctly account for the watchdog start_time and stop_time fields being based on ticks not seconds. This resulted in alarm() returning a bogus number of seconds remaining.
This commit is contained in:
@@ -35,8 +35,14 @@ unsigned int alarm(
|
||||
|
||||
case WATCHDOG_ACTIVE:
|
||||
case WATCHDOG_REMOVE_IT:
|
||||
/*
|
||||
* The stop_time and start_time fields are snapshots of ticks since
|
||||
* boot. Since alarm() is dealing in seconds, we must account for
|
||||
* this.
|
||||
*/
|
||||
|
||||
remaining = the_timer->initial -
|
||||
(the_timer->stop_time - the_timer->start_time);
|
||||
((the_timer->stop_time - the_timer->start_time) / _TOD_Ticks_per_second);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user