Skip to content

Commit

Permalink
fix: improved debug handling, take 2 (EdgeTX#5041)
Browse files Browse the repository at this point in the history
Continuation of EdgeTX#5039
  • Loading branch information
3djc authored May 21, 2024
1 parent 20d0b97 commit 53c794d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions radio/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,17 @@ if(TRACE_AUDIO)
set(DEBUG_TRACE_BUFFER ON)
endif()

if(DEBUG_SEGGER_RTT)
add_definitions(-DDEBUG_SEGGER_RTT)
set(SRC ${SRC} ${THIRDPARTY_DIR}/Segger_RTT/RTT/SEGGER_RTT.c)
if(DEBUG STREQUAL RTT)
set(DEBUG_SEGGER_RTT ON)
add_definitions(-DDEBUG_SEGGER_RTT)
set(SRC ${SRC} ${THIRDPARTY_DIR}/Segger_RTT/RTT/SEGGER_RTT.c)
endif()

if(DEBUG STREQUAL RTT_NO_USB)
set(DEBUG_SEGGER_RTT ON)
add_definitions(-DDEBUG_SEGGER_RTT)
add_definitions(-DDEBUG_DISABLE_USB)
set(SRC ${SRC} ${THIRDPARTY_DIR}/Segger_RTT/RTT/SEGGER_RTT.c)
endif()

if(DEBUG_WINDOWS)
Expand Down Expand Up @@ -532,14 +540,6 @@ set_target_properties(firmware PROPERTIES EXCLUDE_FROM_ALL TRUE)
if(DEBUG)
target_compile_definitions(firmware 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()

target_link_options(firmware PRIVATE
Expand Down

0 comments on commit 53c794d

Please sign in to comment.