diff --git a/third_party/libbase/uart.c b/third_party/libbase/uart.c index 921459f..eda088a 100644 --- a/third_party/libbase/uart.c +++ b/third_party/libbase/uart.c @@ -53,8 +53,8 @@ char uart_read(void) { char c; - if(irq_getie()) { - while(rx_consume == rx_produce); + if (irq_getie()) { + while (rx_consume == rx_produce); } else if (rx_consume == rx_produce) { return 0; } @@ -74,7 +74,7 @@ void uart_write(char c) unsigned int oldmask; unsigned int tx_produce_next = (tx_produce + 1) & UART_RINGBUFFER_MASK_TX; - if(irq_getie()) { + if (irq_getie()) { while(tx_produce_next == tx_consume); } else if(tx_produce_next == tx_consume) { return; @@ -82,7 +82,7 @@ void uart_write(char c) oldmask = irq_getmask(); irq_setmask(oldmask & ~(1 << UART_INTERRUPT)); - if((tx_consume != tx_produce) || uart_txfull_read()) { + if ((tx_consume != tx_produce) || uart_txfull_read()) { tx_buf[tx_produce] = c; tx_produce = tx_produce_next; } else { diff --git a/third_party/printf.c b/third_party/printf.c index c9d62eb..245ac1b 100644 --- a/third_party/printf.c +++ b/third_party/printf.c @@ -255,8 +255,9 @@ void tfp_sprintf(char *s, char *fmt, ...) va_end(va); } - int puts(const char *s) { - while (*s++) +int puts(const char *s) { + while (*s++) stdout_putf(stdout_putp, *s); stdout_putf(stdout_putp, '\n'); - } \ No newline at end of file + return 1; +} \ No newline at end of file