aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/serial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-03-18 13:20:54 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-03-18 13:33:33 -0400
commit1eddc0fd907fb7f28e0b4537494e711f7ac1cac4 (patch)
treec3390bc4c024e231e9cb271231b91b3e232612ad /src/stm32/serial.c
parentc8dc3afc235d9190591056a852f7ff4996c41c54 (diff)
downloadkutter-1eddc0fd907fb7f28e0b4537494e711f7ac1cac4.tar.gz
kutter-1eddc0fd907fb7f28e0b4537494e711f7ac1cac4.tar.xz
kutter-1eddc0fd907fb7f28e0b4537494e711f7ac1cac4.zip
stm32: Simplify USB/Serial/CANbus Kconfig selection
Combine the various communication options into a single "make menuconfig" menu item. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/serial.c')
-rw-r--r--src/stm32/serial.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/stm32/serial.c b/src/stm32/serial.c
index 9c3e7e84..2e11304e 100644
--- a/src/stm32/serial.c
+++ b/src/stm32/serial.c
@@ -12,28 +12,28 @@
#include "sched.h" // DECL_INIT
// Select the configured serial port
-#if CONFIG_SERIAL_PORT == 1
+#if CONFIG_STM32_SERIAL_USART1
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA10,PA9");
#define GPIO_Rx GPIO('A', 10)
#define GPIO_Tx GPIO('A', 9)
#define USARTx USART1
#define USARTx_IRQn USART1_IRQn
-#elif CONFIG_SERIAL_PORT == 2
+#elif CONFIG_STM32_SERIAL_USART2
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA3,PA2");
#define GPIO_Rx GPIO('A', 3)
#define GPIO_Tx GPIO('A', 2)
#define USARTx USART2
#define USARTx_IRQn USART2_IRQn
-#elif CONFIG_SERIAL_PORT == 3
- #if CONFIG_STM32_SERIAL_USART3_ALT
- DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD9,PD8");
- #define GPIO_Rx GPIO('D', 9)
- #define GPIO_Tx GPIO('D', 8)
- #else
- DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB11,PB10");
- #define GPIO_Rx GPIO('B', 11)
- #define GPIO_Tx GPIO('B', 10)
- #endif
+#elif CONFIG_STM32_SERIAL_USART3
+ DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB11,PB10");
+ #define GPIO_Rx GPIO('B', 11)
+ #define GPIO_Tx GPIO('B', 10)
+ #define USARTx USART3
+ #define USARTx_IRQn USART3_IRQn
+#elif CONFIG_STM32_SERIAL_USART3_ALT
+ DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD9,PD8");
+ #define GPIO_Rx GPIO('D', 9)
+ #define GPIO_Tx GPIO('D', 8)
#define USARTx USART3
#define USARTx_IRQn USART3_IRQn
#endif