From c3af39dd2f938c073bca027570946ef32bf04828 Mon Sep 17 00:00:00 2001 From: Mario Mariete <11509521+melkati@users.noreply.github.com> Date: Wed, 1 May 2024 20:37:49 +0200 Subject: [PATCH] Add TIMEDEBUG flag for timing measurements in CO2_Gadget.ino and platformio.ini --- CO2_Gadget.ino | 7 ++++++- platformio.ini | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CO2_Gadget.ino b/CO2_Gadget.ino index 5ab64b12..15cc7eae 100644 --- a/CO2_Gadget.ino +++ b/CO2_Gadget.ino @@ -154,7 +154,12 @@ uint16_t timeToWaitForImprov = 0; // Time in seconds to wait for improv serial #include #include -// Stream& miSerialPort = Serial; +#ifdef TIMEDEBUG +#include "Timer.h" +Timer timer; +Timer timerAwake; +Timer timerLightSleep; +#endif enum notificationTypes { notifyNothing, notifyInfo, diff --git a/platformio.ini b/platformio.ini index 4ea7c34d..f202094b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,8 @@ build_flags = ; -DDEBUG_IMPROV_WIFI ; -DDEBUG_ARDUINOMENU ; -DMENU_DEBUG ; Needs streamFlow library - -DWIFI_PRIVACY ; Comment to show WiFi & MQTT passwords in pain text in serial and the menu (if active no passwords will be shown) + -DWIFI_PRIVACY ; Comment to show WiFi & MQTT passwords in pain text in serial and the menu (if active no passwords will be shown) + -DTIMEDEBUG ; Show timing measurements debug in serial monitor -DDISABLE_DIAGNOSTIC_OUTPUT ; Comment to show e-Ink display diagnostic output in serial monitor -D CORE_DEBUG_LEVEL=0 ; 0=No debug, 1=Error, 2=Warning, 3=Info, 4=Debug, 5=Verbose @@ -66,7 +67,8 @@ lib_deps = https://github.com/melkati/Improv-WiFi-Library.git rlogiacco/Battery Sense @ ^1.1.2 adafruit/Adafruit NeoPixel@^1.10.3 - ; neu-rah/streamFlow @ 0.0.0-alpha+sha.bf16ce8926 ; Needed for -D MENU_DEBUG + ; neu-rah/streamFlow @ 0.0.0-alpha+sha.bf16ce8926 ; Needed for -D MENU_DEBUG + https://github.com/sstaub/Timer.git build_flags = ${features.build_flags} ${debug.build_flags} @@ -74,7 +76,7 @@ build_flags = '-DWIFI_PW_CREDENTIALS=""' -D MQTT_BROKER_SERVER="\"192.168.1.145"\" -D CO2_GADGET_VERSION="\"0.12."\" - -D CO2_GADGET_REV="\"058-development"\" + -D CO2_GADGET_REV="\"059-development"\" -DCACHE_DIR=".pio/build" -DBUZZER_PIN=2 ; ESP32 pin GPIO13 connected to piezo buzzer -DNEOPIXEL_PIN=26 ; Pinnumber for button for down/next and back / exit actions