- X7S option removed (#5388)

- runtime detection of bluetooth chip
This commit is contained in:
3djc
2017-11-19 23:49:38 +01:00
committed by Bertrand Songis
parent d11618eb3f
commit d13fb8918f
8 changed files with 37 additions and 24 deletions
@@ -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) {