Deal with overflow of the COUNT register correctly. The 'cycles_per_hz'
has nothing to do with the rollover. Approved by: imp (mentor)
This commit is contained in:
parent
64ec125306
commit
131ec9efd8
@ -223,9 +223,9 @@ DELAY(int n)
|
||||
|
||||
/* Check to see if the timer has wrapped around. */
|
||||
if (cur < last)
|
||||
delta += (cur + (cycles_per_hz - last));
|
||||
delta += cur + (0xffffffff - last) + 1;
|
||||
else
|
||||
delta += (cur - last);
|
||||
delta += cur - last;
|
||||
|
||||
last = cur;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user