feat: improve debug handling (#5039)
This commit is contained in:
@@ -532,6 +532,14 @@ set_target_properties(firmware PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
|||||||
if(DEBUG)
|
if(DEBUG)
|
||||||
target_compile_definitions(firmware PRIVATE -DDEBUG)
|
target_compile_definitions(firmware PRIVATE -DDEBUG)
|
||||||
target_compile_definitions(stm32_drivers_w_dbg_fw PRIVATE -DDEBUG)
|
target_compile_definitions(stm32_drivers_w_dbg_fw PRIVATE -DDEBUG)
|
||||||
|
if(DEBUG STREQUAL RTT)
|
||||||
|
add_definitions(-DDEBUG_SEGGER_RTT)
|
||||||
|
endif()
|
||||||
|
if(DEBUG STREQUAL RTT_NO_USB)
|
||||||
|
add_definitions(-DDEBUG_SEGGER_RTT)
|
||||||
|
add_definitions(-DDEBUG_DISABLE_USB)
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_options(firmware PRIVATE
|
target_link_options(firmware PRIVATE
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ void setSelectedUsbMode(int mode)
|
|||||||
#if defined(USB_GPIO_PIN_VBUS)
|
#if defined(USB_GPIO_PIN_VBUS)
|
||||||
int usbPlugged()
|
int usbPlugged()
|
||||||
{
|
{
|
||||||
|
#if defined(DEBUG_DISABLE_USB)
|
||||||
|
return(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8_t debouncedState = 0;
|
static uint8_t debouncedState = 0;
|
||||||
static uint8_t lastState = 0;
|
static uint8_t lastState = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user