energia / msp432-core

MSP432 Core and Framework
14 stars 10 forks source link

Stream::timedRead hangs in call to HardwareSerial::read #4

Closed ablatner closed 7 years ago

ablatner commented 8 years ago

Stream::timedRead repeatedly calls HardwareSerial::read without checking if a byte is available. The timer is checked in between calls to read, but within read Semaphore_pend is called with a timeout of BIOS_WAIT_FOREVER. This means that timedRead only returns after a byte is received after the timeout expires. In other words, if all data is received within the timeout, timedRead never returns. Checking HardwareSerial::available before calling HardwareSerial::read seems to fix the problem, though there may be a better solution.

robertinant commented 7 years ago

This has been fixed and will be available in the next release.