From 7349dcba8d352ed60d402fe00a7777796c0b7848 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 21 Apr 2025 00:32:59 +0200 Subject: [PATCH] flash: fixed wait times etc. --- avr/modules/flash/flashprocess.asm | 2 +- avr/modules/flash/io.asm | 2 +- avr/modules/flash/io_bitbang.asm | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/avr/modules/flash/flashprocess.asm b/avr/modules/flash/flashprocess.asm index 47969dc..b703996 100644 --- a/avr/modules/flash/flashprocess.asm +++ b/avr/modules/flash/flashprocess.asm @@ -82,7 +82,7 @@ checkFlash_end: flashProcess: rcall Flash_Init flashProcess_loop1: - ; wait up to 20s for incoming FLASH_DATA message + ; wait up to 10s for incoming FLASH_DATA message ldi r16, CPRO_CMD_FLASH_DATA rcall ioWaitForGivenMsg ; (r16, r17, r18, r19, r20, r22, X) brcc flashProcess_end ; no FLASH_DATA or FLASH_END msg diff --git a/avr/modules/flash/io.asm b/avr/modules/flash/io.asm index 936e488..dae9c22 100644 --- a/avr/modules/flash/io.asm +++ b/avr/modules/flash/io.asm @@ -25,7 +25,7 @@ ; @clobbers: r16, r17, r20, X (r18, r19, r22) ioWaitForGivenMsg: - ldi r20, 100 ; number of tries + ldi r20, 10 ; number of tries ioWaitForGivenMsg_loop: push r16 push r20 diff --git a/avr/modules/flash/io_bitbang.asm b/avr/modules/flash/io_bitbang.asm index 9789c19..a69b6fb 100644 --- a/avr/modules/flash/io_bitbang.asm +++ b/avr/modules/flash/io_bitbang.asm @@ -124,8 +124,8 @@ ioRawSendMsg_attnHigh: ioRawWaitForValidMsg: ldi r16, 0 ; expect ATTN low - ldi r17, 200 - rcall ioWaitForAttnState100ms ; wait for up to 20s + ldi r17, 100 + rcall ioWaitForAttnState100ms ; wait for up to 10s brcs ioRawWaitForValidMsg_attnLow ret ioRawWaitForValidMsg_attnLow: @@ -138,8 +138,8 @@ ioRawWaitForValidMsg_attnLow: ret ioRawWaitForValidMsg_packetReceived: ldi r16, 0xff ; expect ATTN high - ldi r17, 200 - rcall ioWaitForAttnState100ms ; wait for up to 20s + ldi r17, 100 + rcall ioWaitForAttnState100ms ; wait for up to 10s brcc ioRawWaitForValidMsg_end ldi xl, LOW(flashRecvBuffer) ldi xh, HIGH(flashRecvBuffer)