avr: share code.

This commit is contained in:
Martin Preuss
2025-03-23 01:08:33 +01:00
parent 595f983071
commit ebce002614
6 changed files with 51 additions and 49 deletions

View File

@@ -512,19 +512,7 @@ comOnUart0RunSkipping_end:
; @clobbers R16 (R17, R18, R24, R25)
comOnUart0RunMsgReceived:
ldi r17, 0xff
ldd r16, Y+UART_HW_IFACE_OFFS_READBUFNUM
std Y+UART_HW_IFACE_OFFS_READBUFNUM, r17
rcall NET_AddIncomingMsgNum ; (R17, R18, X)
brcs comOnUart0RunMsgReceived_enterIdle
; could not add msg
rcall NET_Buffer_ReleaseByNum ; (R16, X)
ldi r16, NET_IFACE_OFFS_ERR_NOBUF_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
comOnUart0RunMsgReceived_enterIdle:
ldi r17, UART_HW_READMODE_IDLE
std Y+UART_HW_IFACE_OFFS_READMODE, r17 ; set read mode
ret
rjmp UART_HW_Interface_HandleMsgReceived
; @end