@@ -724,6 +724,13 @@ bool isTrainerModeAvailable(int mode)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
if (g_eeGeneral.bluetoothMode && mode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE) {
|
||||
// bluetooth uses the same USART than SBUS
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && !defined(TRAINER_BATTERY_COMPARTMENT)
|
||||
if (mode == TRAINER_MODE_MASTER_BATTERY_COMPARTMENT)
|
||||
return false;
|
||||
|
||||
@@ -107,6 +107,12 @@ void bluetoothInit(uint32_t baudrate, bool enable)
|
||||
void bluetoothDisable()
|
||||
{
|
||||
GPIO_SetBits(BT_EN_GPIO, BT_EN_GPIO_PIN); // close bluetooth (recent modules will go to bootloader mode)
|
||||
USART_ITConfig(BT_USART, USART_IT_RXNE, DISABLE);
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = BT_RX_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_Init(BT_USART_GPIO, &GPIO_InitStructure);
|
||||
USART_DeInit(BT_USART);
|
||||
}
|
||||
|
||||
extern "C" void BT_USART_IRQHandler(void)
|
||||
|
||||
@@ -116,7 +116,7 @@ void boardInit()
|
||||
BT_RCC_APB2Periph,
|
||||
ENABLE);
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
#if defined(BLUETOOTH) && !defined(PCBX9E)
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user