diff options
| author | Louis Burda <quent.burda@gmail.com> | 2022-12-16 20:31:06 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2022-12-16 20:31:06 +0100 |
| commit | 8e8c972cbec56d8de31847981149cde4a8fc16cd (patch) | |
| tree | 3f81fbb17a9e8338bf9b70f3e2059da50aebceca /src/util.c | |
| parent | cbb0ac4dac395ea287cf5e7cc211f81aef16e78f (diff) | |
| download | sxkbd-8e8c972cbec56d8de31847981149cde4a8fc16cd.tar.gz sxkbd-8e8c972cbec56d8de31847981149cde4a8fc16cd.zip | |
Add stdio command interface, matrix syncing and basic evaluation
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,5 +1,6 @@ #include "util.h" #include "board.h" +#include "class/cdc/cdc_device.h" #include "led.h" #include "ws2812.h" @@ -19,7 +20,7 @@ panic_task(const char *fmtstr, va_list ap, uint32_t sleep_ms) static uint32_t start_ms = 0; va_list cpy; - if (!tud_cdc_available()) + if (!tud_cdc_connected()) return; if (!start_ms) start_ms = board_millis(); @@ -29,8 +30,8 @@ panic_task(const char *fmtstr, va_list ap, uint32_t sleep_ms) va_copy(cpy, ap); vprintf(fmtstr, cpy); - printf("\n\r"); - stdio_flush(); + printf("\n"); + tud_cdc_write_flush(); start_ms += sleep_ms; } @@ -41,7 +42,7 @@ stdio_log(int level, const char *fmtstr, ...) { va_list ap; - if (!tud_cdc_available()) + if (!tud_cdc_connected()) return; if (level > loglevel) @@ -50,8 +51,8 @@ stdio_log(int level, const char *fmtstr, ...) va_start(ap, fmtstr); vprintf(fmtstr, ap); va_end(ap); - printf("\n\r"); - stdio_flush(); + printf("\n"); + tud_cdc_write_flush(); } void |
