From 86b14793de79060a450a9571230942f3a7fa721a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 11 May 2024 09:46:39 +0200 Subject: [PATCH] add optional define DEBUG_MUTE This shaves roughly 60k from firmware builds by not including the Logging Ressource strings. Define in variant.h or architecture.h Stats from T-ECHO compiles: Before: Flash: [======== ] 81.5% (used 664700 bytes from 815104 bytes) After: Flash: [======= ] 74.5% (used 606924 bytes from 815104 bytes) --- src/DebugConfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DebugConfiguration.h b/src/DebugConfiguration.h index f0686b811..ca908197e 100644 --- a/src/DebugConfiguration.h +++ b/src/DebugConfiguration.h @@ -36,7 +36,7 @@ #define LOG_CRIT(...) SEGGER_RTT_printf(0, __VA_ARGS__) #define LOG_TRACE(...) SEGGER_RTT_printf(0, __VA_ARGS__) #else -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) #define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__) #define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__) #define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)