From 20521cd8b5e659bb8afb17db7037654431124232 Mon Sep 17 00:00:00 2001 From: dragonchaser Date: Tue, 15 Jul 2025 11:47:45 +0200 Subject: [PATCH] move consts to PROGMEM Signed-off-by: dragonchaser --- btcontrol.ino | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/btcontrol.ino b/btcontrol.ino index 00d1a69..45ad870 100644 --- a/btcontrol.ino +++ b/btcontrol.ino @@ -60,14 +60,15 @@ void Vibrate(); // TODO: add a table here that defines distance in meters for scenarios where the device is in plain sight #define MIN_RSSI_POWER -50 +// Use Serial interface for debugging true|false #define USE_SERIAL false // CONSTS -const std::map overrideColors = { +static const PROGMEM std::map overrideColors = { {"36E898", "FF0000"}, // MiiBand Klaas }; -const std::map blackList = { +static const PROGMEM std::map blackList = { //{ "36E898", nullptr }, }; @@ -75,7 +76,7 @@ const std::map blackList = { #define DEVICE_TYPE_PRIVATE_LAMP 2 #define DEVICE_TYPE_AMULETT 3 -#define DEVICE_TYPE DEVICE_TYPE_PUBLIC_LAMP +#define DEVICE_TYPE DEVICE_TYPE_PRIVATE_LAMP #ifndef DEVICE_TYPE // WE DO NOT HAVE A DEVICETYPE, so we do not have any variables here @@ -85,19 +86,19 @@ const std::map blackList = { #elif DEVICE_TYPE == DEVICE_TYPE_PUBLIC_LAMP // This is a PUBLIC LAMP, no restrictions here // Does not have a vibration motor - static const bool useVibro = false; + static const PROGMEM bool useVibro = false; // WARNING: IF THIS LIST CONTAINS > 0 VALUES, NO OTHER DEVICES WILL BE ALLOWED // IF THIS LIST IS EMPTY IT WILL NOT BE USED - static const std::map whiteList = {}; + static const PROGMEM std::map whiteList = {}; #define LED_DEFAULT_COLOR_ON CRGB::DarkOrange #elif DEVICE_TYPE == DEVICE_TYPE_PRIVATE_LAMP // This is a PRIVATE LAMP, restricted to a list of users // Does not have a vibration motor - static const bool useVibro = false; + static const PROGMEM bool useVibro = false; // WARNING: IF THIS LIST CONTAINS > 0 VALUES, NO OTHER DEVICES WILL BE ALLOWED // IF THIS LIST IS EMPTY IT WILL NOT BE USED - static const std::map whiteList = { + static const PROGMEM std::map whiteList = { { "36E898", nullptr }, }; #define LED_DEFAULT_COLOR_ON CRGB::Black @@ -108,7 +109,7 @@ const std::map blackList = { static const bool useVibro = true; // WARNING: IF THIS LIST CONTAINS > 0 VALUES, NO OTHER DEVICES WILL BE ALLOWED // IF THIS LIST IS EMPTY IT WILL NOT BE USED - static const std::map whiteList = { + static const PROGMEM std::map whiteList = { { "36E898", nullptr }, }; #define LED_DEFAULT_COLOR_ON CRGB::Black