avr: moved code outside of ifdef/endif pair (fixes a bug).

This commit is contained in:
Martin Preuss
2023-03-19 23:22:08 +01:00
parent e5401ee060
commit 4cc2e21a79

View File

@@ -140,6 +140,41 @@ runModulesUntilIdle_ComEnd:
; ---------------------------------------------------------------------------
; initialWait
;
; Initial wait to desync nodes.
;
; This routine waits for between 10 to 2560 milliseconds (derived from UID)
;
; IN:
; - nothing
; OUT:
; - nothing
; USED: r16, r17, r18, r19, r20, r21, r22, X
initialWait:
; setup initial wait loop
rcall Utils_ReadUid ; (R16, X)
clr r16
eor r16, r18
eor r16, r19
eor r16, r20
eor r16, r21
initialWait_l1: ; wait R16 x 10 milliseconds
ldi r17, 200
initialWait_l2: ; wait for 10ms
Utils_WaitNanoSecs 50000, 0, r22 ; wait for 50 microseconds
dec r17
brne initialWait_l2
dec r16
brne initialWait_l1
ret
#ifdef MODULES_LCD
printSendStats:
@@ -275,41 +310,6 @@ sendValueMsg_done:
ret
; ---------------------------------------------------------------------------
; initialWait
;
; Initial wait to desync nodes.
;
; This routine waits for between 10 to 2560 milliseconds (derived from UID)
;
; IN:
; - nothing
; OUT:
; - nothing
; USED: r16, r17, r18, r19, r20, r21, r22, X
initialWait:
; setup initial wait loop
rcall Utils_ReadUid ; (R16, X)
clr r16
eor r16, r18
eor r16, r19
eor r16, r20
eor r16, r21
initialWait_l1: ; wait R16 x 10 milliseconds
ldi r17, 200
initialWait_l2: ; wait for 10ms
Utils_WaitNanoSecs 50000, 0, r22 ; wait for 50 microseconds
dec r17
brne initialWait_l2
dec r16
brne initialWait_l1
ret
textStatsPacketsIn: .db "In : ", 0
textStatsPacketsRecvErr: .db "RecvErr: ", 0
textStatsPacketsOut: .db "Out : ", 0