com2w: check COM_ACCEPT_ALL_DEST
This commit is contained in:
@@ -162,7 +162,6 @@ com2wReceiveNextPkg:
|
|||||||
mov xl, yl
|
mov xl, yl
|
||||||
mov xh, yh
|
mov xh, yh
|
||||||
adiw xh:xl, COM2W_IFACE_OFFS_BUFFER
|
adiw xh:xl, COM2W_IFACE_OFFS_BUFFER
|
||||||
ldd r18, Y+NET_IFACE_OFFS_ADDRESS
|
|
||||||
ldi r19, COM2W_BUFFER_SIZE
|
ldi r19, COM2W_BUFFER_SIZE
|
||||||
rcall com2wRecvMsg ; (r16, r17, r18, r19, r20, r22, r24, r25, X)
|
rcall com2wRecvMsg ; (r16, r17, r18, r19, r20, r22, r24, r25, X)
|
||||||
brcc com2wReceiveNextPkg_end
|
brcc com2wReceiveNextPkg_end
|
||||||
@@ -173,6 +172,25 @@ com2wReceiveNextPkg:
|
|||||||
rcall NETMSG_CheckMessageInBuffer ; (R16, R17, R18, R19, R20, X)
|
rcall NETMSG_CheckMessageInBuffer ; (R16, R17, R18, R19, R20, X)
|
||||||
brcc com2wReceiveNextPkg_eCrc
|
brcc com2wReceiveNextPkg_eCrc
|
||||||
|
|
||||||
|
#ifndef COM_ACCEPT_ALL_DEST
|
||||||
|
; check destination addr
|
||||||
|
mov xl, yl
|
||||||
|
mov xh, yh
|
||||||
|
adiw xh:xl, COM2W_IFACE_OFFS_BUFFER
|
||||||
|
adiw xh:xl, NETMSG_OFFS_DESTADDR
|
||||||
|
ld r16, X ; read destination address
|
||||||
|
cpi r16, 0xff
|
||||||
|
breq com2wReceiveNextPkg_forMe
|
||||||
|
ldd r17, Y+NET_IFACE_OFFS_ADDRESS
|
||||||
|
cp r16, r17
|
||||||
|
breq com2wReceiveNextPkg_forMe
|
||||||
|
; packet not for me, but correctly received, inc counter, but don't light LED
|
||||||
|
ldi r16, NET_IFACE_OFFS_PACKETSIN_LOW
|
||||||
|
rcall NET_Interface_IncCounter16 ; (R24, R25)
|
||||||
|
rjmp com2wReceiveNextPkg_end
|
||||||
|
#endif
|
||||||
|
|
||||||
|
com2wReceiveNextPkg_forMe:
|
||||||
; msg received, alloc buffer for it
|
; msg received, alloc buffer for it
|
||||||
rcall NET_Buffer_Alloc ; R16=buffer num (R16, R17, X)
|
rcall NET_Buffer_Alloc ; R16=buffer num (R16, R17, X)
|
||||||
brcs com2wReceiveNextPkg_gotBuffer
|
brcs com2wReceiveNextPkg_gotBuffer
|
||||||
|
|||||||
Reference in New Issue
Block a user