avr: "Utils_WaitNanoSecs 100000" doesn't work at 8MHz (too many cycles).

This commit is contained in:
Martin Preuss
2024-09-13 21:40:22 +02:00
parent cdcb4e2b3e
commit 2d09e22ec6
2 changed files with 22 additions and 7 deletions

View File

@@ -11,14 +11,28 @@
; ---------------------------------------------------------------------------
; @routine Utils_WaitFor10MicroSecs @global
;
; wait for 10 microsecs (minus cycles for call and ret).
;
; IN:
; - nothing
; OUT:
; - nothing
; REGS: r22
; @clobbers r22
Utils_WaitFor10MicroSecs:
Utils_WaitNanoSecs 10000, 7, r22 ; wait for 10us (minus RCALL and RET)
ret
; @end
; ---------------------------------------------------------------------------
; @routine Utils_WaitFor50MicroSecs @global
;
; wait for 50 microsecs (minus cycles for call and ret).
;
; @clobbers r22
Utils_WaitFor50MicroSecs:
Utils_WaitNanoSecs 50000, 7, r22 ; wait for 50us (minus RCALL and RET)
ret
; @end