Skip to content

Commit

Permalink
disable BT
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic committed Jan 24, 2023
1 parent 0cfcf9b commit f02ba8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions radio/src/targets/common/arm/stm32/bluetooth_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void bluetoothInit(uint32_t baudrate, bool enable)
GPIO_Init(BT_BCTS_GPIO, &GPIO_InitStructure);
#endif

#if 0
#if !defined(BOOT)
GPIO_PinAFConfig(BT_USART_GPIO, BT_TX_GPIO_PinSource, BT_GPIO_AF);
GPIO_PinAFConfig(BT_USART_GPIO, BT_RX_GPIO_PinSource, BT_GPIO_AF);
Expand Down Expand Up @@ -100,6 +101,7 @@ void bluetoothInit(uint32_t baudrate, bool enable)

btRxFifo.clear();
btTxFifo.clear();
#endif
#endif

if (enable)
Expand All @@ -112,14 +114,17 @@ 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)
#if 0
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);
#endif
}

#if 0
extern "C" void BT_USART_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_BLUETOOTH);
Expand Down Expand Up @@ -148,9 +153,11 @@ extern "C" void BT_USART_IRQHandler(void)
}
}
}
#endif

void bluetoothWriteWakeup()
{
#if 0
if (bluetoothWriteState == BLUETOOTH_WRITE_IDLE) {
if (!btTxFifo.isEmpty()) {
#if defined(BT_BRTS_GPIO_PIN)
Expand All @@ -172,6 +179,7 @@ void bluetoothWriteWakeup()
GPIO_SetBits(BT_BRTS_GPIO, BT_BRTS_GPIO_PIN);
}
#endif
#endif
}

uint8_t bluetoothIsWriting(void)
Expand Down

0 comments on commit f02ba8d

Please sign in to comment.