refactor: consolidate timed waits into cpu.wait* routines#35
Conversation
a3f3925 to
41d44fa
Compare
| ; | ||
| ; Wait for about 1ms | ||
| ; | ||
| wait_1ms: phx |
There was a problem hiding this comment.
Here and below, delete local copies of the wait routines, replace calls to local wait_100ms with cpu.wait_100ms.
| bne wait100l | ||
| plx | ||
| rts | ||
| .endn |
There was a problem hiding this comment.
Move the wait_tens implementation below out of the nested namespace so it can be cleanly accessed by all routines in this module.
|
|
||
| ; See comment blocks for `wait_20us` and below | ||
| WAIT_COUNT_6_3MHz = 21 | ||
| WAIT_COUNT_12_6MHz = 47 |
There was a problem hiding this comment.
Extracted 2x-core-aware timed sleep* implementations from iec.asm, renamed to wait*, double-checked & tightened up the timings.
All waits are now 2x-core-compatible Signed-off-by: Aleksey Gurtovoy <aleks@wildbitscomputing.com>
41d44fa to
a2816aa
Compare
|
|
||
|
|
||
| ; Wait for approximately but no less than the specified number of ms | ||
| wait_ms .macro ms |
There was a problem hiding this comment.
Primary API for arbitrary ms waits
| init .proc | ||
|
|
||
| jsr sleep_1ms | ||
| jsr cpu.wait_1ms |
There was a problem hiding this comment.
Here and below, sleep_N -> cpu.wait_N
| eoi_pending .byte ? | ||
| rx_eoi .fill 0 ; shared with mark | ||
| mark .byte ? | ||
| sleep20 .byte ? |
There was a problem hiding this comment.
Moved the calibrated count and the init below sequence to the cpu module.
| _done | ||
| rts | ||
|
|
||
| sleep_20us |
There was a problem hiding this comment.
Moved/reworked as cpu.wait*
| _out: | ||
| rts | ||
|
|
||
| wait_ms .macro ms |
There was a problem hiding this comment.
Deleted another set of superseded local routines
All waits are now 2x-core-compatible.