s5j/serial: fix RX availability check
authorHeesub Shin <heesub.shin@samsung.com>
Wed, 13 Sep 2017 07:02:17 +0000 (16:02 +0900)
committersunghan <sh924.chang@samsung.com>
Wed, 20 Sep 2017 08:49:02 +0000 (17:49 +0900)
commita99d0fcad58096ac9a4d037bac1bd2f3da9f66ef
tree37e614f38460c3f98fbe0fbcb740a049cda1ed9a
parent86ac347145f5bfd5c3ff203db15aea5810c830a5
s5j/serial: fix RX availability check

UFSTAT[7:0] holds the number of data in Rx FIFO, but zero when Rx FIFO
is full. Thus, we need additional check on UFSTAT[8] bit to ensure that
the FIFO is empty, if the count is zero. Otherwise, up_rxavailable() may
return 'false' even when Rx FIFO is full, though it is less likely to
happen.

Change-Id: Iffd65bf356dd840e864553daf8aa9a7f04a0368e
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
os/arch/arm/src/s5j/s5j_serial.c