lancaster-university / microbit-dal

http://lancaster-university.github.io/microbit-docs
Other
256 stars 130 forks source link

MicroBitSerial::read(ASYNC) skips incoming bytes #441

Open martinwork opened 5 years ago

martinwork commented 5 years ago

https://github.com/lancaster-university/microbit-dal/blob/master/source/drivers/MicroBitSerial.cpp#L649

while((temp = getChar(mode)) != MICROBIT_NO_DATA && bufferIndex < bufferLen)

The order of the tests needs reversing. Similar to #201, which has been fixed.

I'll make a PR.