diff --git a/source/drivers/MicroBitSerial.cpp b/source/drivers/MicroBitSerial.cpp index 5fcf9e5..7fad4e0 100644 --- a/source/drivers/MicroBitSerial.cpp +++ b/source/drivers/MicroBitSerial.cpp @@ -88,12 +88,13 @@ MicroBitSerial::MicroBitSerial(PinName tx, PinName rx, uint8_t rxBufferSize, uin */ void MicroBitSerial::dataReceived() { + //get the received character + //Note: always read from the serial to clear the RX interrupt + char c = getc(); + if(!(status & MICROBIT_SERIAL_RX_BUFF_INIT)) return; - //get the received character - char c = getc(); - int delimeterOffset = 0; int delimLength = this->delimeters.length();