File tree 3 files changed +20
-2
lines changed
examples/platform/silabs/SiWx917
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,10 @@ source_set("siwx917-common") {
241
241
public_deps += [ " ${ chip_root } /examples/common/QRCode" ]
242
242
}
243
243
244
+ if (sl_uart_log_output ) {
245
+ sources += [ " ${ silabs_common_plat_dir } /SiWx917/uart.cpp" ]
246
+ }
247
+
244
248
if (enable_heap_monitoring ) {
245
249
sources += [ " ${ silabs_common_plat_dir } /MemMonitoring.cpp" ]
246
250
}
Original file line number Diff line number Diff line change 55
55
#endif
56
56
57
57
#if SILABS_LOG_OUT_UART
58
+ #include " rsi_debug.h"
58
59
#include " uart.h"
59
60
#endif
60
61
@@ -135,12 +136,18 @@ static void PrintLog(const char * msg)
135
136
sz = strlen (msg);
136
137
137
138
#if SILABS_LOG_OUT_UART
138
- uartLogWrite (msg, sz);
139
+ for (/* Empty */ ; sz != 0 ; --sz)
140
+ {
141
+ Board_UARTPutChar (*msg++);
142
+ }
143
+ // To print next log in new line with proper formatting
144
+ Board_UARTPutChar (' \r ' );
145
+ Board_UARTPutChar (' \n ' );
139
146
#elif PW_RPC_ENABLED
140
147
PigweedLogger::putString (msg, sz);
141
148
#else
142
149
SEGGER_RTT_WriteNoLock (LOG_RTT_BUFFER_INDEX, msg, sz);
143
- #endif
150
+ #endif // SILABS_LOG_OUT_UART
144
151
145
152
#if SILABS_LOG_OUT_RTT || PW_RPC_ENABLED
146
153
const char * newline = " \r\n " ;
Original file line number Diff line number Diff line change @@ -282,6 +282,13 @@ template("siwx917_sdk") {
282
282
}
283
283
}
284
284
285
+ if (sl_uart_log_output ) {
286
+ defines += [
287
+ " SILABS_LOG_OUT_UART=1" ,
288
+ " SILABS_LOG_OUT_RTT=0" ,
289
+ ]
290
+ }
291
+
285
292
if (chip_build_libshell ) { # matter shell
286
293
defines += [ " ENABLE_CHIP_SHELL" ]
287
294
}
You can’t perform that action at this time.
0 commit comments