receiving works again.

This commit is contained in:
Martin Preuss
2025-05-31 15:36:52 +02:00
parent 061119819f
commit be74442e7f
2 changed files with 31 additions and 19 deletions

View File

@@ -78,7 +78,7 @@ uartBitbang_RawReceiveMsg:
breq uartBitbang_RawReceiveMsg_forMe
cpi r16, 0xff
breq uartBitbang_RawReceiveMsg_forMe
clr r16
clr r16 ; not for me
rjmp uartBitbang_RawReceiveMsg_clcRet
uartBitbang_RawReceiveMsg_forMe:
subi r19, 1
@@ -87,10 +87,10 @@ uartBitbang_RawReceiveMsg_forMe:
; read size of msg payload (e.g. number of msg bytes following minus CRC byte)
rcall uartBitbang_ReceiveByte ; read byte (R16, R17, R20, R21, R22)
brcc uartBitbang_RawReceiveMsg_eIo
inc r16 ; account for crc byte
subi r19, 1
brcs uartBitbang_RawReceiveMsg_eBadSize
st X+, r16 ; store msg payload size
inc r16 ; account for crc byte
sub r19, r16 ; check msg size against remaining buffer size
brcs uartBitbang_RawReceiveMsg_eBadSize
mov r19, r16