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:
Joel Sherrill
2000-07-07 19:31:30 +00:00
parent 5f4d774ea7
commit df97683373
2 changed files with 14 additions and 2 deletions

View File

@@ -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;
}