Skip to content

Commit f237657

Browse files
committed
extended buffer check to usb_cdc_background
1 parent ccbe557 commit f237657

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ports/atmel-samd/usb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ bool usb_connected(void) {
331331
void usb_cdc_background() {
332332
//
333333
if (mp_interrupt_char != -1 && cdc_enabled() && !pending_read) {
334-
start_read();
334+
// Make sure we have space in the buffer
335+
if (usb_rx_count < 64) {
336+
start_read();
337+
}
335338
}
336339
}

0 commit comments

Comments
 (0)