Sleep with __wfi() between USB interrupts instead of busy-polling

This commit is contained in:
Ian Gulliver
2026-04-05 20:36:34 +09:00
parent 401008b5a7
commit d33b711378

View File

@@ -57,10 +57,9 @@ int main() {
while (true) { while (true) {
tud_task(); tud_task();
if (!tud_cdc_available()) continue; while (tud_cdc_available()) {
uint8_t byte; uint8_t byte;
if (tud_cdc_read(&byte, 1) != 1) continue; if (tud_cdc_read(&byte, 1) != 1) break;
rx_buf.push_back(byte); rx_buf.push_back(byte);
@@ -90,4 +89,7 @@ int main() {
} }
} }
} }
__wfi();
}
} }