]> git.zerfleddert.de Git - fnordlicht-mini/commitdiff
more tx disabling.
authorgitknilch <gitknilch@cwde.de>
Sun, 20 Feb 2011 12:03:41 +0000 (13:03 +0100)
committergitknilch <gitknilch@cwde.de>
Sun, 20 Feb 2011 12:03:41 +0000 (13:03 +0100)
firmware/fnordlicht-firmware/remote.c
firmware/fnordlicht-firmware/uart.h

index fcaf672e298ec03ea748dae8375512e6504b6bdc..dcef098c7336e3960435e21bd41c3e36b0157948 100644 (file)
@@ -430,10 +430,15 @@ void parse_config_startup(struct remote_msg_config_startup_t *msg)
     storage_save_config();
 }
 
     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());
 }
 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)
 {
 
 void parse_bootloader(struct remote_msg_bootloader_t *msg)
 {
index ceeb4f0cfcae4c7724b894f7562eae7375080cb4..8db8f3feb901e871a8c038d0b26e0d4f2808bfe1 100644 (file)
@@ -38,7 +38,9 @@
 /* structs */
 struct global_uart_t {
     fifo_t rx;
 /* structs */
 struct global_uart_t {
     fifo_t rx;
+#if UART_TX_ENABLED
     fifo_t tx;
     fifo_t tx;
+#endif
 };
 
 /* global variables */
 };
 
 /* global variables */
@@ -48,10 +50,15 @@ extern volatile struct global_uart_t global_uart;
 void uart_init(void);
 void uart_putc(uint8_t data);
 
 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;
 }
 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
 
 
 #endif
 
Impressum, Datenschutz