Skip to content

Commit d012fd1

Browse files
committed
Only write to usb when its around.
1 parent 355abc8 commit d012fd1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

supervisor/shared/serial.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ bool serial_bytes_available(void) {
4848
}
4949

5050
void serial_write_substring(const char* text, uint32_t length) {
51+
if (!tud_cdc_connected()) {
52+
return;
53+
}
5154
uint32_t count = 0;
5255
while (count < length) {
5356
count += tud_cdc_write(text + count, length - count);

0 commit comments

Comments
 (0)