com2w: work in COM2W_Run, not in COM2W_Every100ms

This commit is contained in:
Martin Preuss
2025-08-25 10:20:13 +02:00
parent 66ac029a69
commit 7efaf720cc

View File

@@ -116,7 +116,6 @@ COM2W_Every100ms:
in r15, SREG in r15, SREG
cli cli
rcall NET_Interface_Periodically ; (R16) rcall NET_Interface_Periodically ; (R16)
rcall com2wSendNextPkg
out SREG, r15 out SREG, r15
pop r15 pop r15
ret ret
@@ -124,6 +123,31 @@ COM2W_Every100ms:
; ---------------------------------------------------------------------------
; @routine COM2W_Run @global
;
; @clobbers (R16, R17, R18, R20, R22, R24, R25, X)
COM2W_Run:
push r15
in r15, SREG
cli
ldi yl, LOW(com2w_iface)
ldi yh, HIGH(com2w_iface)
rcall com2wSendNextPkg ; (R16, R17, R18, R20, R22, R24, R25, X)
brcs COM2W_Run_ok
pop r15
clc
rjmp COM2W_Run_ret
COM2W_Run_ok:
pop r15
sec
COM2W_Run_ret:
ret
; @end
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine com2wReceiveNextPkg ; @routine com2wReceiveNextPkg
; ;
@@ -182,6 +206,9 @@ com2wReceiveNextPkg_copyLoop:
brcc com2wReceiveNextPkg_eMissed brcc com2wReceiveNextPkg_eMissed
ldi r16, NET_IFACE_OFFS_PACKETSIN_LOW ldi r16, NET_IFACE_OFFS_PACKETSIN_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25) rcall NET_Interface_IncCounter16 ; (R24, R25)
#ifdef MODULES_LED_ACTIVITY
rcall LedActivity_Trigger ; (r16)
#endif
sec sec
rjmp com2wReceiveNextPkg_end rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_eCrc: com2wReceiveNextPkg_eCrc: