From 98bf036f92989f4cec734a6056b566b9c7714c49 Mon Sep 17 00:00:00 2001 From: Ton Huisman Date: Sat, 14 Dec 2024 14:00:24 +0100 Subject: [PATCH 1/5] [P021] Move ifdef to .h file to avoid compiler warnings --- src/_P021_Level.ino | 148 +++++------------------ src/src/PluginStructs/P021_data_struct.h | 102 ++++++++++++++++ 2 files changed, 129 insertions(+), 121 deletions(-) create mode 100644 src/src/PluginStructs/P021_data_struct.h diff --git a/src/_P021_Level.ino b/src/_P021_Level.ino index 3453edfa19..b6903c355a 100644 --- a/src/_P021_Level.ino +++ b/src/_P021_Level.ino @@ -9,6 +9,9 @@ // Extended by timer based state control to support pumps with additional requirements (floor heating ciculation pump) // Changelog: +// 2024-12-14, tonhuisman: Move most defines to .h file to avoid compiler warnings, as Arduino doesn't support #ifdef in .ino files +// Format source using Uncrustify +// Remove unneeded includes // 2024-07-07, flashmark: Reworked to support floor heating pump (added state machine control) // 2023-03-13, tonhuisman: Add setting to invert the Output state // 2022-08-22, tonhuisman: Add setting to auto-save a changed setting after x minutes, size optimizations, add PCONFIG defines @@ -29,28 +32,9 @@ // Minimum build size is expected to be true when extras >=1 ////////////////////////////////////////////////////////////////////////////////////////////////////////// -# include "src/Helpers/ESPEasy_math.h" # include "src/Globals/RulesCalculate.h" -# include "src/WebServer/ESPEasy_WebServer.h" - -//// #define LIMIT_BUILD_SIZE -# define PLUGIN_021_DEBUG - -// For additional debugging information use PLUGIN_021_DEBUG (see note) -# ifdef BUILD_NO_DEBUG -# undef PLUGIN_021_DEBUG -# else // ifdef BUILD_NO_DEBUG -////# define PLUGIN_021_DEBUG -# endif // ifndef/else BUILD_NO_DEBUG - -// See note at top of file -# ifdef LIMIT_BUILD_SIZE -# define FEATURE_P021_EXTRAS 0 -# define P021_MIN_BUILD_SIZE -# undef PLUGIN_021_DEBUG -# else // ifdef LIMIT_BUILD_SIZE -# define FEATURE_P021_EXTRAS 1 -# endif // ifdef LIMIT_BUILD_SIZE + +# include "src/PluginStructs/P021_data_struct.h" # define PLUGIN_021 # define PLUGIN_ID_021 21 @@ -58,86 +42,6 @@ # define PLUGIN_VALUENAME1_021 "Output" # define PLUGIN_VALUENAME2_021 "State" -# define P021_GPIO_RELAY CONFIG_PIN1 - -// Define the configuration options using ESPeasy standard structures -// For unique identification on the HTML form use P021_GUID_