diff options
author | Josh Blum <josh@joshknows.com> | 2012-01-04 10:26:00 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-01-04 10:26:00 -0800 |
commit | f2388c07ecff5a3488c6ef23852321df54292934 (patch) | |
tree | 92f6e1653765a40bdc95f18ed639ccf4f534c0fc /firmware/zpu/lib/udp_uart.c | |
parent | 1b2108274aeec3733f84c82bee885ab9a4da4c26 (diff) | |
download | uhd-f2388c07ecff5a3488c6ef23852321df54292934.tar.gz uhd-f2388c07ecff5a3488c6ef23852321df54292934.tar.bz2 uhd-f2388c07ecff5a3488c6ef23852321df54292934.zip |
usrp2: fw fix for hal_uart_getc_noblock return code
Diffstat (limited to 'firmware/zpu/lib/udp_uart.c')
-rw-r--r-- | firmware/zpu/lib/udp_uart.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/zpu/lib/udp_uart.c b/firmware/zpu/lib/udp_uart.c index 6f6b9ee91..a3940c05f 100644 --- a/firmware/zpu/lib/udp_uart.c +++ b/firmware/zpu/lib/udp_uart.c @@ -94,8 +94,9 @@ void udp_uart_poll(void){ //read all characters we can without blocking for (size_t j = state->len; j < sizeof(_states[0].buf); j++){ - uint8_t ch = hal_uart_getc_noblock((hal_uart_name_t)i); - if (ch == 255) break; + int ret = hal_uart_getc_noblock((hal_uart_name_t)i); + if (ret == -1) break; + char ch = (char) ret; if (ch == '\n' || ch == '\r') newline = true; state->buf[j] = ch; state->len++; |