From 691363129b2ad518ab204b80f9cca1d0de0a81db Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Mon, 3 Jan 2022 00:08:34 +0100 Subject: [PATCH] initial try of custom type in config lib --- main/ledstrip.h | 18 ++++++++++++------ main/newsettings.h | 6 ------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main/ledstrip.h b/main/ledstrip.h index ed1e446..80f0c41 100644 --- a/main/ledstrip.h +++ b/main/ledstrip.h @@ -4,6 +4,7 @@ #include // 3rdparty lib includes +#include #include // local includes @@ -23,12 +24,17 @@ enum Bobbycar_Side }; #ifdef FEATURE_OTA -enum OtaAnimationModes -{ - None, - GreenProgressBar, - ColorChangeAll -}; +//enum OtaAnimationModes +//{ +// None, +// GreenProgressBar, +// ColorChangeAll +//}; +#define OtaAnimationModesValues(x) \ + x(None) \ + x(GreenProgressBar) \ + x(ColorChangeAll) +DECLARE_TYPESAFE_ENUM(OtaAnimationModes, : uint8_t, OtaAnimationModesValues) #endif extern std::vector leds; diff --git a/main/newsettings.h b/main/newsettings.h index f8a3cbe..39c24cd 100644 --- a/main/newsettings.h +++ b/main/newsettings.h @@ -23,13 +23,7 @@ // local includes #include "ledstrip.h" -#define REMOVE_TRAILING_COMMA_N(_1,_2,_3,_4,_5,_6,_7,_8,_9,N,...) \ - REMOVE_TRAILING_COMMA_##N -#define REMOVE_TRAILING_COMMA(...) \ - REMOVE_TRAILING_COMMA_N(__VA_ARGS__,9,8,7,6,5,4,3,2,1)(__VA_ARGS__) - using namespace espconfig; -#define __CONFIG__START nullptr std::string defaultHostname();