Skip net_poll and timers unless their interrupt has fired

This commit is contained in:
Ian Gulliver
2026-04-10 22:00:34 +09:00
parent 8edf8c2d4f
commit f2d98ef4f1
4 changed files with 15 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ void pio_init() {
gpio_set_dir(PIN_INT, GPIO_IN);
gpio_pull_up(PIN_INT);
gpio_set_irq_enabled_with_callback(PIN_INT, GPIO_IRQ_EDGE_FALL, true,
[](uint, uint32_t){});
[](uint, uint32_t){ irq_pending = true; });
pio_hw_t *pios[2] = {pio0, pio1};
uint pio_index = 1;
@@ -490,6 +490,8 @@ std::expected<void, sock_error> close(socket_id sid) {
} // namespace
volatile bool irq_pending = false;
void clear_interrupt(intr_kind intr) {
set_irclr((uint8_t)intr);
uint8_t sir = (uint8_t)((uint16_t)intr >> 8);