esp32s3: use TIMG0 alarm interrupt for sleepTicks

Replace the busy-wait sleepTicks with an interrupt-driven version that
sets a TIMG0 timer alarm and waits for the interrupt to fire. The timer
alarm handler disables INT_ENA at the peripheral level to prevent
level-triggered re-assertion; sleepTicks re-enables it after each wake.

This avoids burning CPU cycles during time.Sleep and similar delays.
This commit is contained in:
deadprogram
2026-04-02 14:09:47 +02:00
parent a6a4f85e61
commit 27e5baeb57
2 changed files with 60 additions and 4 deletions
+3
View File
@@ -80,6 +80,9 @@ func main() {
// Set up the Xtensa interrupt vector table.
interruptInit()
// Initialize timer alarm interrupt for the scheduler.
initTimerInterrupt()
// Initialize the heap, call main.main, etc.
run()