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

@@ -22,10 +22,10 @@
; @return CFLAG set if okay (packet received), cleared on error
; @return r16 code of received msg
; @param r16 command to wait for
; @param r20 number of tries (low number when waiting for FLASH_START, higher when waiting for FLASH_DATA)
; @clobbers: r16, r17, r20, X (r18, r19, r22)
ioWaitForGivenMsg:
ldi r20, 10 ; number of tries
ioWaitForGivenMsg_loop:
push r16
push r20