Use BT detection on X-Lite too (current prod has no module, preprod has one, future batches unknown)

This commit is contained in:
Kilrah
2018-07-08 15:49:10 +02:00
parent 9904d6deb0
commit 1383afb36f
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ enum BluetoothStates {
#define LEN_BLUETOOTH_ADDR 16 #define LEN_BLUETOOTH_ADDR 16
#if defined(PCBX7) #if (defined(PCBX7) || defined(PCBXLITE)) && !defined(SIMU)
extern uint8_t btChipPresent; extern uint8_t btChipPresent;
#define IS_BLUETOOTH_CHIP_PRESENT() (btChipPresent) #define IS_BLUETOOTH_CHIP_PRESENT() (btChipPresent)
#else #else
@@ -23,7 +23,7 @@
Fifo<uint8_t, 64> btTxFifo; Fifo<uint8_t, 64> btTxFifo;
Fifo<uint8_t, 64> btRxFifo; Fifo<uint8_t, 64> btRxFifo;
#if defined(PCBX7) #if defined(PCBX7) || defined(PCBXLITE)
uint8_t btChipPresent = 0; uint8_t btChipPresent = 0;
#endif #endif
@@ -109,9 +109,9 @@ extern "C" void BT_USART_IRQHandler(void)
USART_ClearITPendingBit(BT_USART, USART_IT_RXNE); USART_ClearITPendingBit(BT_USART, USART_IT_RXNE);
uint8_t byte = USART_ReceiveData(BT_USART); uint8_t byte = USART_ReceiveData(BT_USART);
btRxFifo.push(byte); btRxFifo.push(byte);
#if defined(PCBX7) #if defined(PCBX7) || defined(PCBXLITE)
if (!btChipPresent) { if (!btChipPresent) {
// This is to differentiate X7 and X7S // This is to differentiate X7 and X7S and X-Lite with/without BT
btChipPresent = 1; btChipPresent = 1;
bluetoothDone(); bluetoothDone();
} }