flash: wait for ATTN high before waiting for message.
this helps with syncing.
This commit is contained in:
@@ -101,8 +101,8 @@ ioRawInit:
|
||||
ioRawSendMsg:
|
||||
ioRawSendMsg_loop:
|
||||
ldi r16, 0xff ; expect ATTN high
|
||||
ldi r17, 3
|
||||
rcall ioWaitForAttnState100ms ; wait for up to 300ms
|
||||
ldi r17, 10
|
||||
rcall ioWaitForAttnState100ms ; wait for up to 1s
|
||||
brcs ioRawSendMsg_attnHigh
|
||||
ret
|
||||
ioRawSendMsg_attnHigh:
|
||||
@@ -117,12 +117,21 @@ ioRawSendMsg_attnHigh:
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine ioRawWaitForValidMsg
|
||||
;
|
||||
; Wait for valid incoming msg
|
||||
;
|
||||
; First waits for ATTN line to go high (released) then wait for ATTN
|
||||
; line to go low. This way we will only start listening at the beginning of
|
||||
; a message.
|
||||
;
|
||||
; @return CFLAG set if okay (packet received), cleared on error
|
||||
; @clobbers: r16, r17 (r18, r19, r20, r21, r22, X)
|
||||
|
||||
ioRawWaitForValidMsg:
|
||||
ldi r16, 0xff ; expect ATTN high
|
||||
ldi r17, 100
|
||||
rcall ioWaitForAttnState100ms ; wait for up to 10s
|
||||
brcc ioRawWaitForValidMsg_end ; ATTN not high, exit
|
||||
ldi r16, 0 ; expect ATTN low
|
||||
ldi r17, 100
|
||||
rcall ioWaitForAttnState100ms ; wait for up to 10s
|
||||
|
||||
Reference in New Issue
Block a user