altos/stm: Add ability to delay STDIO usage for serial ports
authorKeith Packard <keithp@keithp.com>
Sun, 1 Feb 2015 15:36:51 +0000 (16:36 +0100)
committerKeith Packard <keithp@keithp.com>
Sun, 1 Feb 2015 15:36:51 +0000 (16:36 +0100)
Bluetooth needs to delay adding the serial port to stdio until the
link is up and running. The cc1111 serial driver had
DELAY_SERIAL_*_STDIN bits which have been added to the STM serial driver.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_serial_stm.c

index e356b9441c3e4bce2381e07ee1b88556534bf63e..2568cf430fe5cb92eccc751ae463d2e8c8ccf796 100644 (file)
@@ -348,7 +348,7 @@ ao_serial_init(void)
 
        stm_nvic_set_enable(STM_ISR_USART1_POS);
        stm_nvic_set_priority(STM_ISR_USART1_POS, 4);
-#if USE_SERIAL_1_STDIN
+#if USE_SERIAL_1_STDIN && !DELAY_SERIAL_1_STDIN
        ao_add_stdio(_ao_serial1_pollchar,
                     ao_serial1_putchar,
                     NULL);
@@ -395,7 +395,7 @@ ao_serial_init(void)
 
        stm_nvic_set_enable(STM_ISR_USART2_POS);
        stm_nvic_set_priority(STM_ISR_USART2_POS, 4);
-#if USE_SERIAL_2_STDIN
+#if USE_SERIAL_2_STDIN && !DELAY_SERIAL_2_STDIN
        ao_add_stdio(_ao_serial2_pollchar,
                     ao_serial2_putchar,
                     NULL);
@@ -439,7 +439,7 @@ ao_serial_init(void)
 
        stm_nvic_set_enable(STM_ISR_USART3_POS);
        stm_nvic_set_priority(STM_ISR_USART3_POS, 4);
-#if USE_SERIAL_3_STDIN
+#if USE_SERIAL_3_STDIN && !DELAY_SERIAL_3_STDIN
        ao_add_stdio(_ao_serial3_pollchar,
                     ao_serial3_putchar,
                     NULL);