com2w: fixed a bug (on CRC error the buffer is not yet allocated).

This commit is contained in:
Martin Preuss
2025-09-08 22:04:53 +02:00
parent 679865f68b
commit 2b2c41867f

View File

@@ -188,9 +188,9 @@ com2wReceiveNextPkg:
ldi r16, NET_IFACE_OFFS_PACKETSIN_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_forMe:
#endif
com2wReceiveNextPkg_forMe:
; msg received, alloc buffer for it
rcall NET_Buffer_Alloc ; R16=buffer num (R16, R17, X)
brcs com2wReceiveNextPkg_gotBuffer
@@ -232,11 +232,9 @@ com2wReceiveNextPkg_copyLoop:
#endif
rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_eCrc:
push r16
ldi r16, NET_IFACE_OFFS_ERR_CONTENT_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
pop r16
rjmp com2wReceiveNextPkg_relBuffer
ldi r16, NET_IFACE_OFFS_ERR_CONTENT_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
rjmp com2wReceiveNextPkg_end
com2wReceiveNextPkg_eMissed:
push r16
ldi r16, NET_IFACE_OFFS_ERR_MISSED_LOW