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.
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.