summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/serial.c12
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));
}