avr: updated flash procedure code.

This commit is contained in:
Martin Preuss
2025-01-19 15:44:46 +01:00
parent ba279ae2bb
commit c390b1059c
12 changed files with 653 additions and 67 deletions

View File

@@ -112,34 +112,6 @@ flashWaitForSpecificMessage_received: ; R16 contains message type
; ---------------------------------------------------------------------------
; Wait for up to 1ms for ATTN line to reach the given state
;
; IN:
; - R16: expected state (0xff for high, 0 for low)
; OUT:
; - CFLAG: set if state reached, cleared otherwise
; REGS: R24 (R22)
flashWaitForAttnState1ms:
cbi COM_ATTN_DDR, COM_ATTN_PIN ; set ATTN port as input
cbi COM_ATTN_OUTPUT, COM_ATTN_PIN ; disable internal pullup for ATTN
ldi r24, 100
flashWaitForAttnState1ms_loop:
push r17
in r17, COM_ATTN_INPUT
eor r17, r16
andi r17, (1<<COM_ATTN_PIN)
pop r17
breq flashWaitForAttnState1ms_stateReached
rcall Utils_WaitFor10MicroSecs ; wait for 10us (R22)
dec r24
brne flashWaitForAttnState1ms_loop
rjmp flash_recv_clc_ret
flashWaitForAttnState1ms_stateReached:
rjmp flash_recv_sec_ret
flash_recv_clc_ret:
clc
ret