esp32: add interrupt-based UART RX and fix init order

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2026-07-09 00:45:31 +02:00
committed by Ron Evans
parent 94736ac0e5
commit 8727b696a5
2 changed files with 152 additions and 8 deletions
+7 -4
View File
@@ -47,18 +47,21 @@ func main() {
// faster.
clearbss()
// Initialize UART.
machine.InitSerial()
// Initialize main system timer used for time.Now.
initTimer()
// Set up the Xtensa interrupt vector table.
// Set up the Xtensa interrupt vector table. This zeroes INTENABLE, so it
// must run before any peripheral (UART, timer, etc) enables its own CPU
// interrupt line - otherwise that enable would be wiped out here.
interruptInit()
// Initialize timer alarm interrupt for the scheduler.
initTimerInterrupt()
// Initialize UART. This enables the UART RX interrupt, which must happen
// after interruptInit so the INTENABLE bit is not cleared again.
machine.InitSerial()
// Initialize the heap, call main.main, etc.
run()