avr/uart_hw: basically works for a while then stops...

This commit is contained in:
Martin Preuss
2025-03-21 20:55:50 +01:00
parent 2964347e7b
commit 373a553ac8
14 changed files with 685 additions and 122 deletions

View File

@@ -276,7 +276,7 @@ ttyOnUart1RunWaitBufferEmpty:
; ---------------------------------------------------------------------------
; @routine ttyOnUart1RunWriteBufferEmpty
;
; @clobbers R16, R17, X
; @clobbers R16, R17, X (R24, R25)
ttyOnUart1RunWriteBufferEmpty:
ldd r16, Y+UART_HW_IFACE_OFFS_WRITEBUFNUM
@@ -328,6 +328,7 @@ ttyOnUart1RunReadIdle:
rcall NET_Buffer_Alloc ; (R16, R17, X)
brcc ttyOnUart1RunReadIdle_noBuf
rcall UART_HW_Interface_SetReadBuffer ; (R17)
rcall NET_Interface_SetIfaceNumInBuffer ; (R16, R17)
ttyOnUart1RunReadIdle_enterReading:
ldi r16, UART_HW_READMODE_READING
std Y+UART_HW_IFACE_OFFS_READMODE, r16
@@ -380,14 +381,14 @@ ttyOnUart1RunMsgReceived:
breq ttyOnUart1RunMsgReceived_end
rcall NET_AddIncomingMsgNum ; (R17, R18, X)
brcs ttyOnUart1RunMsgReceived_enterIdle
ttyOnUart1RunMsgReceived_overrun: ; reset/reuse current buffer
rcall NET_Buffer_Locate
rcall UART_HW_Interface_SetReadBuffer ; (R17)
ttyOnUart1RunMsgReceived_overrun:
rcall NET_Buffer_ReleaseByNum ; (R16, X)
ldi r16, NET_IFACE_OFFS_ERR_NOBUF_LOW
rcall NET_Interface_IncCounter16 ; (R24, R25)
ttyOnUart1RunMsgReceived_enterIdle:
ldi r16, 0xff
std Y+UART_HW_IFACE_OFFS_READBUFNUM, r16
ldi r16, UART_HW_READMODE_IDLE
std Y+UART_HW_IFACE_OFFS_READMODE, r16
ttyOnUart1RunMsgReceived_end: