storage_save_config();
}
+#if UART_TX_ENABLED
static void wait_for_uart(void)
{
while (fifo_fill((fifo_t *)&global_uart.tx) != 0 || !uart_send_complete());
}
+#else
+/* no need to wait for me */
+#define wait_for_uart()
+#endif
void parse_bootloader(struct remote_msg_bootloader_t *msg)
{
/* structs */
struct global_uart_t {
fifo_t rx;
+#if UART_TX_ENABLED
fifo_t tx;
+#endif
};
/* global variables */
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