diff --git a/lib/utils/serial/shakti-uart.c b/lib/utils/serial/shakti-uart.c index 5f2fe75c..35569356 100644 --- a/lib/utils/serial/shakti-uart.c +++ b/lib/utils/serial/shakti-uart.c @@ -19,21 +19,21 @@ #define REG_RX_THRES 0x20 #define UART_TX_FULL 0x2 +#define UART_RX_NOT_EMPTY 0x4 #define UART_RX_FULL 0x8 static volatile char *uart_base; static void shakti_uart_putc(char ch) { - while((readw(uart_base + REG_STATUS) & UART_TX_FULL)) + while ((readb(uart_base + REG_STATUS) & UART_TX_FULL)) ; writeb(ch, uart_base + REG_TX); } static int shakti_uart_getc(void) { - u16 status = readw(uart_base + REG_STATUS); - if (status & UART_RX_FULL) + if (readb(uart_base + REG_STATUS) & UART_RX_NOT_EMPTY) return readb(uart_base + REG_RX); return -1; }