Skip to content

Commit

Permalink
SILABS_OUT_RTT is not used or defined anywhere outside of Logging.cpp…
Browse files Browse the repository at this point in the history
…, and was redundant with SILABS_OUT_UART
  • Loading branch information
lpbeliveau-silabs committed Nov 27, 2024
1 parent b156273 commit 24fb63b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
13 changes: 4 additions & 9 deletions src/platform/silabs/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@
#include "uart.h"
#endif

// Enable RTT by default
#ifndef SILABS_LOG_OUT_RTT
#define SILABS_LOG_OUT_RTT 1
#endif

// SEGGER_RTT includes
#if SILABS_LOG_OUT_RTT
#if !SILABS_LOG_OUT_UART
#include "SEGGER_RTT.h"
#include "SEGGER_RTT_Conf.h"
#endif
Expand Down Expand Up @@ -137,7 +132,7 @@ static void PrintLog(const char * msg)
SEGGER_RTT_WriteNoLock(LOG_RTT_BUFFER_INDEX, msg, sz);
#endif // SILABS_LOG_OUT_UART

#if SILABS_LOG_OUT_RTT || PW_RPC_ENABLED
#if !SILABS_LOG_OUT_UART || PW_RPC_ENABLED
const char * newline = "\r\n";
sz = strlen(newline);
#if PW_RPC_ENABLED
Expand All @@ -155,7 +150,7 @@ static void PrintLog(const char * msg)
extern "C" void silabsInitLog(void)
{
#if SILABS_LOG_ENABLED
#if SILABS_LOG_OUT_RTT
#if !SILABS_LOG_OUT_UART
#if LOG_RTT_BUFFER_INDEX != 0
SEGGER_RTT_ConfigUpBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sLogBuffer, LOG_RTT_BUFFER_SIZE,
SEGGER_RTT_MODE_NO_BLOCK_TRIM);
Expand All @@ -165,7 +160,7 @@ extern "C" void silabsInitLog(void)
#else
SEGGER_RTT_SetFlagsUpBuffer(LOG_RTT_BUFFER_INDEX, SEGGER_RTT_MODE_NO_BLOCK_TRIM);
#endif
#endif // SILABS_LOG_OUT_RTT
#endif // !SILABS_LOG_OUT_UART

#ifdef PW_RPC_ENABLED
PigweedLogger::init();
Expand Down
5 changes: 1 addition & 4 deletions third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,7 @@ template("siwx917_sdk") {
}

if (sl_uart_log_output) {
defines += [
"SILABS_LOG_OUT_UART=1",
"SILABS_LOG_OUT_RTT=0",
]
defines += [ "SILABS_LOG_OUT_UART=1" ]
}

if (chip_build_libshell) { # matter shell
Expand Down
5 changes: 1 addition & 4 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,7 @@ template("efr32_sdk") {
}

if (sl_uart_log_output) {
defines += [
"SILABS_LOG_OUT_UART=1",
"SILABS_LOG_OUT_RTT=0",
]
defines += [ "SILABS_LOG_OUT_UART=1" ]
}

if (use_silabs_thread_lib) {
Expand Down

0 comments on commit 24fb63b

Please sign in to comment.