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 154166d commit c8094e7Copy full SHA for c8094e7
cores/arduino/USB/CDC.cpp
@@ -199,9 +199,11 @@ void Serial_::end(void)
199
memset((void*)&_usbLineInfo, 0, sizeof(_usbLineInfo));
200
}
201
202
+int _serialPeek = -1;
203
+
204
int Serial_::available(void)
205
{
- return usb.available(CDC_ENDPOINT_OUT);
206
+ return usb.available(CDC_ENDPOINT_OUT) + (_serialPeek != -1);
207
208
209
int Serial_::availableForWrite(void)
@@ -211,8 +213,6 @@ int Serial_::availableForWrite(void)
211
213
return (EPX_SIZE - 1);
212
214
215
-int _serialPeek = -1;
-
216
int Serial_::peek(void)
217
218
if (_serialPeek != -1)
0 commit comments