X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fnordlicht-mini/blobdiff_plain/e06282dce0420369b589ec793c567a8a2cc48603..a73d0f32629447c5eb40fcfc9d1e4fcd8437aae7:/firmware/fnordlicht-firmware/uart.h diff --git a/firmware/fnordlicht-firmware/uart.h b/firmware/fnordlicht-firmware/uart.h index ceeb4f0..8db8f3f 100644 --- a/firmware/fnordlicht-firmware/uart.h +++ b/firmware/fnordlicht-firmware/uart.h @@ -38,7 +38,9 @@ /* structs */ struct global_uart_t { fifo_t rx; +#if UART_TX_ENABLED fifo_t tx; +#endif }; /* global variables */ @@ -48,10 +50,15 @@ extern volatile struct global_uart_t global_uart; void uart_init(void); void uart_putc(uint8_t data); +#if UART_TX_ENABLED static inline bool uart_send_complete(void) { return _BV(_UDRE_UART0) & _UCSRA_UART0; } +#else +/* we're never incomplete, never. */ +#define uart_send_complete() 1 +#endif #endif