diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-11-09 16:41:08 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-11-09 16:41:08 -0800 |
| commit | 355abc835ea75715b4dea38604ef64f8c4eeaa0f (patch) | |
| tree | 7e7c16e386157a42f686b27dbb6731738683befa /supervisor | |
| parent | 97bc95183d5114ce69c9387ebd2e2aa13feb65a7 (diff) | |
Fix output overflow and make help translatable
Diffstat (limited to 'supervisor')
| -rw-r--r-- | supervisor/shared/serial.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 058c4a7a4..cd20b5c26 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -47,10 +47,14 @@ bool serial_bytes_available(void) { return tud_cdc_available() > 0; } -void serial_write(const char* text) { - tud_cdc_write(text, strlen(text)); +void serial_write_substring(const char* text, uint32_t length) { + uint32_t count = 0; + while (count < length) { + count += tud_cdc_write(text + count, length - count); + usb_background(); + } } -void serial_write_substring(const char* text, uint32_t length) { - tud_cdc_write(text, length); +void serial_write(const char* text) { + serial_write_substring(text, strlen(text)); } |
