Reserve USB KISS framing before normal parsers consume it
This commit is contained in:
1 parent
ff51126508
commit
1aef6de288
20 files changed
+624
-10
No files matched your search
@@ -307,6 +307,10 @@ size_t ArduinoSerialInterface::checkRecvFrame(uint8_t dest[]) {
|
||||
// host must not keep the radio/watchdog loop trapped in this parser.
|
||||
int pending = _serial->available();
|
||||
while (pending-- > 0) {
|
||||
// Input can arrive after the role's initial protocol-owner poll. Leave a
|
||||
// reserved first byte for that owner without consuming its framing.
|
||||
if (_state == RECV_STATE_IDLE && _idle_receive_check != nullptr
|
||||
&& !_idle_receive_check(_serial->peek())) return 0;
|
||||
int c = _serial->read();
|
||||
if (c < 0) break;
|
||||
_last_rx_byte_ms = millis();
|
||||
|
||||
Reference in new issue
Block a user