From 2b2c41867fe3ffb59c1880fa429ffa0c19e3ef0b Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 8 Sep 2025 22:04:53 +0200 Subject: [PATCH] com2w: fixed a bug (on CRC error the buffer is not yet allocated). --- avr/modules/com2w/com2w.asm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/avr/modules/com2w/com2w.asm b/avr/modules/com2w/com2w.asm index 5ecfbb0..6f2f056 100644 --- a/avr/modules/com2w/com2w.asm +++ b/avr/modules/com2w/com2w.asm @@ -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