Commit 1a96364
committed
Fix counter scheduling when target equals max value
When target is 0xFFFF, the CountToTarget and CountToOverflow events
coincide at the same counter value. Skip the redundant target phase
and schedule CountToOverflow directly, so the overflow flag is visible
on the first mode register read without requiring two update() calls.
Restore small target values for tests that only check flag presence,
keeping the larger target only for the back-to-back read test.
Signed-off-by: Nicolas 'Pixel' Noble <nicolas@nobis-crew.org>1 parent 76df40a commit 1a96364
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
0 commit comments