Skip to content

Commit 9b75837

Browse files
committed
Added some checks to enable uart logging for SoC and efr.
1 parent f193f78 commit 9b75837

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

examples/platform/silabs/SiWx917/BUILD.gn

+1-5
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ source_set("siwx917-common") {
223223
"SiWx917/wfx_rsi_host.c",
224224
]
225225

226-
if (chip_enable_pw_rpc || chip_build_libshell) {
226+
if (chip_enable_pw_rpc || chip_build_libshell || sl_uart_log_output) {
227227
sources += [ "uart.cpp" ]
228228
}
229229

@@ -241,10 +241,6 @@ source_set("siwx917-common") {
241241
public_deps += [ "${chip_root}/examples/common/QRCode" ]
242242
}
243243

244-
if (sl_uart_log_output) {
245-
sources += [ "${silabs_common_plat_dir}/SiWx917/uart.cpp" ]
246-
}
247-
248244
if (enable_heap_monitoring) {
249245
sources += [ "${silabs_common_plat_dir}/MemMonitoring.cpp" ]
250246
}

src/platform/silabs/Logging.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
#endif
5656

5757
#if SILABS_LOG_OUT_UART
58+
#if SIWX_917
5859
#include "rsi_debug.h"
60+
#endif // SIWX_917
5961
#include "uart.h"
6062
#endif
6163

@@ -136,13 +138,17 @@ static void PrintLog(const char * msg)
136138
sz = strlen(msg);
137139

138140
#if SILABS_LOG_OUT_UART
141+
#if SIWX_917
139142
for (/* Empty */; sz != 0; --sz)
140143
{
141144
Board_UARTPutChar(*msg++);
142145
}
143146
// To print next log in new line with proper formatting
144147
Board_UARTPutChar('\r');
145148
Board_UARTPutChar('\n');
149+
#else
150+
uartLogWrite(msg, sz);
151+
#endif // SIWX_917
146152
#elif PW_RPC_ENABLED
147153
PigweedLogger::putString(msg, sz);
148154
#else

0 commit comments

Comments
 (0)