sipeed / Maixduino

Arduino port on Maix board ( k210 )
https://maixduino.sipeed.com
Other
213 stars 93 forks source link

Fixed receiving the NUL '\x00' character on Serial #65

Closed epozzobon closed 4 years ago

epozzobon commented 4 years ago

The previous code was checking whether the uarths_getc() function returned 0 to check if no data was available on the serial interrupt. However, uarths_getc() returns EOF if there is nothing to read, and EOF is defined in stdio.h to be -1. This caused UARTClass to not be able to receive the 0 character.