From f237657e5ebc592c2a8f37546c19a421ee5f37f8 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 23 Mar 2018 18:41:27 +0000 Subject: [PATCH] extended buffer check to usb_cdc_background --- ports/atmel-samd/usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/usb.c b/ports/atmel-samd/usb.c index c95ec06b78..6148c56ae6 100644 --- a/ports/atmel-samd/usb.c +++ b/ports/atmel-samd/usb.c @@ -331,6 +331,9 @@ bool usb_connected(void) { void usb_cdc_background() { // if (mp_interrupt_char != -1 && cdc_enabled() && !pending_read) { - start_read(); + // Make sure we have space in the buffer + if (usb_rx_count < 64) { + start_read(); + } } }