WFI with interrupt-driven wakeup for USB and W6300

This commit is contained in:
Ian Gulliver
2026-04-10 12:55:04 +09:00
parent 3d20bf4c33
commit 0c11cbb1d1
4 changed files with 27 additions and 4 deletions

View File

@@ -8,6 +8,7 @@
#include "timer_queue.h"
#include "net.h"
#include "debug_log.h"
#include "hardware/sync.h"
static timer_queue timers;
@@ -39,6 +40,8 @@ void dispatch_schedule_ms(uint32_t ms, std::function<void()> fn) {
});
while (true) {
uint32_t save = save_and_disable_interrupts();
dlog_if_slow("tud_task", 1000, [&]{ tud_task(); });
dlog_if_slow("drain", 1000, [&]{ usb.drain(); });
dlog_if_slow("timers", 1000, [&]{ timers.run(); });
@@ -76,6 +79,7 @@ void dispatch_schedule_ms(uint32_t ms, std::function<void()> fn) {
}
}
// __wfi();
__wfi();
restore_interrupts(save);
}
}