diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index 61d5c349119a55..9214e97adef89e 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -223,7 +223,7 @@ source_set("siwx917-common") { "SiWx917/wfx_rsi_host.c", ] - if (chip_enable_pw_rpc || chip_build_libshell) { + if (chip_enable_pw_rpc || chip_build_libshell || sl_uart_log_output) { sources += [ "uart.cpp" ] } @@ -241,10 +241,6 @@ source_set("siwx917-common") { public_deps += [ "${chip_root}/examples/common/QRCode" ] } - if (sl_uart_log_output) { - sources += [ "${silabs_common_plat_dir}/SiWx917/uart.cpp" ] - } - if (enable_heap_monitoring) { sources += [ "${silabs_common_plat_dir}/MemMonitoring.cpp" ] } diff --git a/src/platform/silabs/Logging.cpp b/src/platform/silabs/Logging.cpp index 7b47d14ea26a08..72e9e4faa86ff0 100644 --- a/src/platform/silabs/Logging.cpp +++ b/src/platform/silabs/Logging.cpp @@ -55,7 +55,9 @@ #endif #if SILABS_LOG_OUT_UART +#if SIWX_917 #include "rsi_debug.h" +#endif // SIWX_917 #include "uart.h" #endif @@ -136,6 +138,7 @@ static void PrintLog(const char * msg) sz = strlen(msg); #if SILABS_LOG_OUT_UART +#if SIWX_917 for (/* Empty */; sz != 0; --sz) { Board_UARTPutChar(*msg++); @@ -143,6 +146,9 @@ static void PrintLog(const char * msg) // To print next log in new line with proper formatting Board_UARTPutChar('\r'); Board_UARTPutChar('\n'); +#else + uartLogWrite(msg, sz); +#endif // SIWX_917 #elif PW_RPC_ENABLED PigweedLogger::putString(msg, sz); #else