avr: added routine com2WaitForDataState1ms (not yet used).

This commit is contained in:
Martin Preuss
2023-04-20 00:44:30 +02:00
parent 600a6d01ac
commit 39c4bcd720

View File

@@ -185,10 +185,40 @@ com2WaitForAttnHigh_done:
ret
; ---------------------------------------------------------------------------
; comWaitFor100ns
; com2WaitForDataState1ms
;
; Waits for 100 nanoseconds.
; Waits up to COM2_MAXWAIT_US loops for high ATTN line
; IN:
; OUT:
; - CFLAG: set if state reached, cleared otherwise
; REGS: R24 (R22)
com2WaitForDataState1ms:
ldi r24, 100
com2WaitForDataState1ms_loop:
push r17
in r17, COM_PIN_DATA
eor r17, r16
andi r17, (1<<COM_PINNUM_DATA)
pop r17
breq com2WaitForDataState1ms_stateReached
Utils_WaitNanoSecs 10000, 0, r22 ; wait for 10us
dec r24
brne com2WaitForDataState1ms_loop
clc
ret
com2WaitForDataState1ms_stateReached:
sec
ret
; ---------------------------------------------------------------------------
; comWaitFor1000ns
;
; Waits for 1000 nanoseconds.
; IN:
; OUT:
; - CFLAG: set if okay, clear otherwise