Add a DEBUG_BLUETOOTH option

This commit is contained in:
dlktdr
2021-12-10 22:46:42 +01:00
committed by Risto
parent 48bd1ac738
commit 8a7ba1bd96
3 changed files with 11 additions and 3 deletions
+5 -2
View File
@@ -56,8 +56,11 @@ enum BluetoothStates {
f_printf(&g_bluetoothFile, __VA_ARGS__); \
TRACE_NOCRLF(__VA_ARGS__);
#else
#define BLUETOOTH_TRACE(...) \
TRACE_NOCRLF(__VA_ARGS__);
#if defined(DEBUG_BLUETOOTH)
#define BLUETOOTH_TRACE(...) TRACE_NOCRLF(__VA_ARGS__);
#else
#define BLUETOOTH_TRACE(...)
#endif
#endif
class Bluetooth
@@ -23,6 +23,7 @@ option(DEBUG_LATENCY "Debug latency" OFF)
option(DEBUG_USB_INTERRUPTS "Count individual USB interrupts" OFF)
option(DEBUG_TASKS "Task switching statistics" OFF)
option(DEBUG_TIMERS "Time critical parts of the code" OFF)
option(DEBUG_BLUETOOTH "Debug Bluetooth" OFF)
# option to select the default internal module
#set(DEFAULT_INTERNAL_MODULE NONE CACHE STRING "Default internal module")
@@ -141,6 +142,10 @@ if(DEBUG_LATENCY STREQUAL END_TO_END)
add_definitions(-DDEBUG_LATENCY_END_TO_END)
endif()
if(DEBUG_BLUETOOTH)
add_definitions(-DDEBUG_BLUETOOTH)
endif()
if(CLI)
add_definitions(-DCLI)
set(FIRMWARE_SRC ${FIRMWARE_SRC} cli.cpp)
@@ -123,7 +123,7 @@ extern "C" void BT_USART_IRQHandler(void)
USART_ClearITPendingBit(BT_USART, USART_IT_RXNE);
uint8_t byte = USART_ReceiveData(BT_USART);
btRxFifo.push(byte);
TRACE("BT %02X", byte);
BLUETOOTH_TRACE("BT %02X", byte);
#if defined(BLUETOOTH_PROBE)
if (!btChipPresent) {
// This is to differentiate X7 and X7S and X-Lite with/without BT