avr: more work on ardware uart code.

This commit is contained in:
Martin Preuss
2025-02-09 21:06:31 +01:00
parent 601559ca6e
commit 703f8042f9
8 changed files with 698 additions and 97 deletions

View File

@@ -129,7 +129,8 @@ devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; v
firmwareVersion: .db FIRMWARE_VARIANT_TEMP_WINDOW, FIRMWARE_VERSION_MAJOR
.db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL
;firmwareStart: rjmp main
firmwareStart:
cli
; setup stack
@@ -160,10 +161,11 @@ main_loop:
and r16, r17
ori r16, (1<<SE) ; sleep mode "idle", enable
out MCUCR, r16
sei ; make sure interrupts really are enabled
sei ; make sure interrupts really are enabled
sleep ; sleep, wait for interrupt
rcall BaseTimer_Run
rcall TtyOnUart1_Run
rjmp main_loop
@@ -196,6 +198,7 @@ onSystemTimerTick:
rcall LedSimple_Every100ms
#endif
rcall TtyOnUart1_Periodically
ret
@@ -228,6 +231,7 @@ initModules:
rcall BaseTimer_Init
rcall LedSimple_Init
rcall UART_HW_Init
rcall TtyOnUart1_Init
ret
; @end
@@ -255,9 +259,11 @@ initModules:
.include "modules/uart_hw/defs.asm"
.include "modules/uart_hw/buffers.asm"
.include "modules/uart_hw/lowlevel.asm"
.include "modules/uart_hw/m_lowlevel_uart.asm"
.include "modules/uart_hw/lowlevel_uart1.asm"
.include "modules/uart_hw/msglevel_recv.asm"
.include "modules/uart_hw/msglevel_send.asm"
.include "modules/uart_hw/ttyonuart1.asm"