avr/modules/flash: make protocol more robust

- wait for ATTN high after error receiving a packet
- use different wait times when waiting for FLASH_START and FLASH_DATA
This commit is contained in:
Martin Preuss
2025-05-05 21:05:07 +02:00
parent 9063962c7d
commit eecb022a0c
4 changed files with 13 additions and 5 deletions

View File

@@ -135,6 +135,11 @@ ioRawWaitForValidMsg_attnLow:
ldi r17, FLASH_RECVBUFFER_MAXLEN-3
rcall ioRawReceivePacketIntoBuffer
brcs ioRawWaitForValidMsg_packetReceived
; wait until ATTN is high (up to 10s)
ldi r16, 0xff ; expect ATTN high
ldi r17, 100
rcall ioWaitForAttnState100ms ; wait for up to 10s
clc
ret
ioRawWaitForValidMsg_packetReceived:
ldi r16, 0xff ; expect ATTN high