From c9fc236576da2608308d3d2c8cd200ea147e004f Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Tue, 7 Jun 2022 08:47:44 +0200 Subject: [PATCH] sys/ztimer: no log for stdio_rtt/semihosting Both modules use ztimer for stdio, so can't call stdio based functions before the module is initialized --- sys/ztimer/init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/ztimer/init.c b/sys/ztimer/init.c index f400644308bf..20d9f0c0e748 100644 --- a/sys/ztimer/init.c +++ b/sys/ztimer/init.c @@ -49,6 +49,13 @@ #include "ztimer/periph_rtc.h" #include "ztimer/config.h" +/* both 'stdio_rtt' and 'stdio_semihosting' rely on ztimer for stdio output, + so not output is possible before 'ztimer' has been initiated, silence all + logs */ +#if IS_USED(MODULE_STDIO_RTT) || IS_USED(MODULE_STDIO_SEMIHOSTING) +#undef LOG_LEVEL +#define LOG_LEVEL LOG_NONE +#endif #include "log.h" #define WIDTH_TO_MAXVAL(width) (UINT32_MAX >> (32 - width))