mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-02 19:36:04 +01:00
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>
This commit is contained in:
@@ -12,28 +12,28 @@
|
||||
#include "sched.h" // DECL_INIT
|
||||
|
||||
// Select the configured serial port
|
||||
#if CONFIG_SERIAL_PORT == 1
|
||||
#if CONFIG_STM32_SERIAL_USART1_ALT
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA15,PA14");
|
||||
#define GPIO_Rx GPIO('A', 15)
|
||||
#define GPIO_Tx GPIO('A', 14)
|
||||
#else
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA10,PA9");
|
||||
#define GPIO_Rx GPIO('A', 10)
|
||||
#define GPIO_Tx GPIO('A', 9)
|
||||
#endif
|
||||
#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
|
||||
#if CONFIG_STM32_SERIAL_USART2_ALT
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA15,PA14");
|
||||
#define GPIO_Rx GPIO('A', 15)
|
||||
#define GPIO_Tx GPIO('A', 14)
|
||||
#else
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA3,PA2");
|
||||
#define GPIO_Rx GPIO('A', 3)
|
||||
#define GPIO_Tx GPIO('A', 2)
|
||||
#endif
|
||||
#elif CONFIG_STM32_SERIAL_USART1_ALT
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA15,PA14");
|
||||
#define GPIO_Rx GPIO('A', 15)
|
||||
#define GPIO_Tx GPIO('A', 14)
|
||||
#define USARTx USART1
|
||||
#define USARTx_IRQn USART1_IRQn
|
||||
#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_STM32_SERIAL_USART2_ALT
|
||||
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA15,PA14");
|
||||
#define GPIO_Rx GPIO('A', 15)
|
||||
#define GPIO_Tx GPIO('A', 14)
|
||||
#define USARTx USART2
|
||||
#define USARTx_IRQn USART2_IRQn
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user