Skip to content

Commit

Permalink
fix: BT defined on T15
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick committed Aug 17, 2024
1 parent 4b87484 commit fc1b330
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
7 changes: 6 additions & 1 deletion radio/src/targets/horus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
42 changes: 27 additions & 15 deletions radio/src/targets/horus/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit fc1b330

Please sign in to comment.