We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d787240 commit a899505Copy full SHA for a899505
cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_CDC.cpp
@@ -67,15 +67,21 @@ Adafruit_USBD_CDC::operator bool()
67
bool ret = tud_cdc_connected();
68
69
// Add an yield to run usb background in case sketch block wait as follows
70
- // while(!Serial) {}
+ // while( !Serial ) {}
71
if ( !ret ) yield();
72
73
return ret;
74
}
75
76
int Adafruit_USBD_CDC::available(void)
77
{
78
- return tud_cdc_available();
+ uint32_t count = tud_cdc_available();
79
+
80
+ // Add an yield to run usb background in case sketch block wait as follows
81
+ // while( !Serial.available() ) {}
82
+ if (!count) yield();
83
84
+ return count;
85
86
87
int Adafruit_USBD_CDC::peek(void)
0 commit comments