diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-11-09 17:06:55 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-11-09 17:06:55 -0800 |
| commit | d012fd155338641f1d54d68d04410a848e07319d (patch) | |
| tree | e44644757b48721a75d23b4794850124482f50c9 /supervisor | |
| parent | 355abc835ea75715b4dea38604ef64f8c4eeaa0f (diff) | |
Only write to usb when its around.
Diffstat (limited to 'supervisor')
| -rw-r--r-- | supervisor/shared/serial.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index cd20b5c26..c57688ddc 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -48,6 +48,9 @@ bool serial_bytes_available(void) { } void serial_write_substring(const char* text, uint32_t length) { + if (!tud_cdc_connected()) { + return; + } uint32_t count = 0; while (count < length) { count += tud_cdc_write(text + count, length - count); |
