From 2cf887800412b27a06f662f4f84d515f6bf3553a Mon Sep 17 00:00:00 2001 From: 3djc Date: Sat, 17 Aug 2024 14:10:31 +0200 Subject: [PATCH] fix: BT defined on T15 (#5445) --- radio/src/targets/horus/CMakeLists.txt | 7 ++++++- radio/src/targets/horus/hal.h | 26 +++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index a43feb56c..9db01414a 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -69,7 +69,12 @@ if (PCB STREQUAL X10) set(DEFAULT_INTERNAL_MODULE CROSSFIRE CACHE STRING "Default internal module") option(BLUETOOTH "Support for bluetooth module" OFF) option(INTERNAL_GPS "Support for internal NMEA GPS" OFF) - set(AUX_SERIAL ON) + if (BLUETOOTH) + set(AUX_SERIAL OFF) + else() + set(AUX_SERIAL ON) + endif() + # Aux2 is reserved for serial gimbal on this radio set(AUX2_SERIAL OFF) add_definitions(-DMANUFACTURER_JUMPER) set(LCD_DRIVER lcd_st7796s_driver.cpp) diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index 1ad62adc8..b93d70936 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -1051,14 +1051,22 @@ // Bluetooth #define STORAGE_BLUETOOTH #if defined(BLUETOOTH) - #define BT_USART USART6 - #define BT_USART_IRQn USART6_IRQn - #define BT_USART_GPIO GPIOG - #define BT_TX_GPIO GPIO_PIN(GPIOG, 14) // PG.14 - #define BT_RX_GPIO GPIO_PIN(GPIOG, 9) // PG.09 -#if defined(RADIO_TX16S) - #define BT_PWR_GPIO GPIO_PIN(GPIOB, 0) // PB.00 -#endif + #if defined(RADIO_T15) + #define BT_USART USART3 + #define BT_USART_IRQn USART3_IRQn + #define BT_USART_GPIO GPIOB + #define BT_TX_GPIO GPIO_PIN(GPIOB, 10) // PB.10 + #define BT_RX_GPIO GPIO_PIN(GPIOB, 11) // PB.11 + #else + #define BT_USART USART6 + #define BT_USART_IRQn USART6_IRQn + #define BT_USART_GPIO GPIOG + #define BT_TX_GPIO GPIO_PIN(GPIOG, 14) // PG.14 + #define BT_RX_GPIO GPIO_PIN(GPIOG, 9) // PG.09 + #if defined(RADIO_TX16S) + #define BT_PWR_GPIO GPIO_PIN(GPIOB, 0) // PB.00 + #endif + #endif #endif #if defined(PCBX12S) @@ -1071,7 +1079,7 @@ // #define BT_BRTS_GPIO_PIN GPIO_Pin_10 // PG.10 // #define BT_BCTS_GPIO GPIOG // #define BT_BCTS_GPIO_PIN GPIO_Pin_11 // PG.11 -#elif defined(PCBX10) +#elif defined(PCBX10) && !defined(RADIO_T15) #define BT_EN_GPIO GPIO_PIN(GPIOG, 10) // PG.10 #endif