altos/telebt-v3.0: Fix stdio setup for BTM
authorKeith Packard <keithp@keithp.com>
Sun, 1 Feb 2015 15:43:06 +0000 (16:43 +0100)
committerKeith Packard <keithp@keithp.com>
Sun, 1 Feb 2015 15:43:06 +0000 (16:43 +0100)
Make sure the BTM module is allowed to be included in stdio, but delay
adding that until the BT link is running.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/telebt-v3.0/ao_pins.h

index 0d03f94de6ea35271c2e353296a9310cd375a2a3..f178c34902b943b1bdded54bcd0b25940c785a8d 100644 (file)
 #define SERIAL_1_PA9_PA10      1
 
 #define HAS_SERIAL_2           1
-#define USE_SERIAL_2_STDIN     0
+#define USE_SERIAL_2_STDIN     1
+#define DELAY_SERIAL_2_STDIN   1
 #define USE_SERIAL_2_FLOW      1
 #define SERIAL_2_PA2_PA3       1
 #define SERIAL_2_PD5_PD6       0
 
-#define HAS_SERIAL_3           1
+#define HAS_SERIAL_3           0
 #define USE_SERIAL_3_STDIN     0
 #define SERIAL_3_PB10_PB11     1
 #define SERIAL_3_PC10_PC11     0
@@ -170,7 +171,7 @@ struct ao_adc {
 #define _ao_serial_btm_sleep   _ao_serial2_sleep
 #define ao_serial_btm_set_speed ao_serial2_set_speed
 #define ao_serial_btm_drain    ao_serial2_drain
-#define ao_serial_btm_rx_fifo  ao_serial2_rx_fifo
+#define ao_serial_btm_rx_fifo  (ao_stm_usart2.rx_fifo)
 
 #define AO_BTM_INT_PORT                (&stm_gpioa)
 #define AO_BTM_INT_PIN         15