From fc1b3306f4face7f05fb27a1c6b397adf7be547b Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 17 Aug 2024 00:59:48 +0000 Subject: [PATCH] fix: BT defined on T15 --- radio/src/targets/horus/CMakeLists.txt | 7 ++++- radio/src/targets/horus/hal.h | 42 +++++++++++++++++--------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index e421c9ff666..45e1b7e16a8 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -79,7 +79,12 @@ if (PCB STREQUAL X10) set(DEFAULT_INTERNAL_MODULE MULTIMODULE 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 64d35463021..d081d724fed 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -1240,21 +1240,31 @@ // Bluetooth #define STORAGE_BLUETOOTH #if defined(BLUETOOTH) -#define BT_RCC_APB2Periph RCC_APB2Periph_USART6 -#define BT_USART USART6 -#define BT_GPIO_AF LL_GPIO_AF_8 -#define BT_USART_IRQn USART6_IRQn -#define BT_USART_GPIO GPIOG -#define BT_TX_GPIO_PIN LL_GPIO_PIN_14 // PG.14 -#define BT_RX_GPIO_PIN LL_GPIO_PIN_9 // PG.09 -#define BT_USART_IRQHandler USART6_IRQHandler -#if defined(RADIO_TX16S) - #define BT_PWR_GPIO GPIOB - #define BT_PWR_GPIO_PIN LL_GPIO_PIN_0 // PB.00 -#endif + #if defined(RADIO_T15) + #define BT_RCC_APB2Periph RCC_APB2Periph_USART6 + #define BT_USART USART3 + #define BT_USART_IRQn USART3_IRQn + #define BT_USART_GPIO GPIOB + #define BT_TX_GPIO_PIN LL_GPIO_PIN_10 // PB.10 + #define BT_RX_GPIO_PIN LL_GPIO_PIN_11 // PB.11 + #else + #define BT_RCC_APB2Periph RCC_APB2Periph_USART6 + #define BT_USART USART6 + #define BT_GPIO_AF LL_GPIO_AF_8 + #define BT_USART_IRQn USART6_IRQn + #define BT_USART_GPIO GPIOG + #define BT_TX_GPIO_PIN LL_GPIO_PIN_14 // PG.14 + #define BT_RX_GPIO_PIN LL_GPIO_PIN_9 // PG.09 + #define BT_USART_IRQHandler USART6_IRQHandler + #if defined(RADIO_TX16S) + #define BT_PWR_GPIO GPIOB + #define BT_PWR_GPIO_PIN LL_GPIO_PIN_0 // PB.00 + #endif + #endif #else -#define BT_RCC_APB2Periph 0 + #define BT_RCC_APB2Periph 0 #endif + #if defined(PCBX12S) #if PCBREV >= 13 #define BT_RCC_AHB1Periph (RCC_AHB1Periph_GPIOI | RCC_AHB1Periph_GPIOG) @@ -1271,8 +1281,10 @@ // #define BT_BCTS_GPIO_PIN GPIO_Pin_11 // PG.11 #elif defined(PCBX10) #define BT_RCC_AHB1Periph RCC_AHB1Periph_GPIOG - #define BT_EN_GPIO GPIOG - #define BT_EN_GPIO_PIN LL_GPIO_PIN_10 // PG.10 + #if !defined(RADIO_T15) + #define BT_EN_GPIO GPIOG + #define BT_EN_GPIO_PIN LL_GPIO_PIN_10 // PG.10 + #endif #endif // Video switch