@@ -2,7 +2,7 @@
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
@@ -23,6 +23,10 @@
|
||||
Fifo<uint8_t, 64> btTxFifo;
|
||||
Fifo<uint8_t, 64> btRxFifo;
|
||||
|
||||
#if defined(PCBX7)
|
||||
uint8_t btChipPresent = 0;
|
||||
#endif
|
||||
|
||||
enum BluetoothWriteState
|
||||
{
|
||||
BLUETOOTH_WRITE_IDLE,
|
||||
@@ -105,6 +109,12 @@ extern "C" void BT_USART_IRQHandler(void)
|
||||
USART_ClearITPendingBit(BT_USART, USART_IT_RXNE);
|
||||
uint8_t byte = USART_ReceiveData(BT_USART);
|
||||
btRxFifo.push(byte);
|
||||
#if defined(PCBX7)
|
||||
if (!btChipPresent) { //This is to differentiate X7 and X7S
|
||||
btChipPresent = 1;
|
||||
bluetoothDone();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (USART_GetITStatus(BT_USART, USART_IT_TXE) != RESET) {
|
||||
|
||||
Reference in New Issue
Block a user