From a7c3361b60a7200d5f53084720466b211465a5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sat, 25 Aug 2018 09:18:02 +0200 Subject: [PATCH] Move WebUI image calculation after sensors.h (#1142) --- code/espurna/config/all.h | 1 + code/espurna/config/dependencies.h | 51 ------------------------------ code/espurna/config/webui.h | 50 +++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 code/espurna/config/webui.h diff --git a/code/espurna/config/all.h b/code/espurna/config/all.h index f1be16f0..9aca96a8 100644 --- a/code/espurna/config/all.h +++ b/code/espurna/config/all.h @@ -32,6 +32,7 @@ #include "dependencies.h" #include "prototypes.h" #include "sensors.h" +#include "webui.h" #include "progmem.h" #include "debug.h" diff --git a/code/espurna/config/dependencies.h b/code/espurna/config/dependencies.h index 0661b2ba..6bc3f5ab 100644 --- a/code/espurna/config/dependencies.h +++ b/code/espurna/config/dependencies.h @@ -53,54 +53,3 @@ #undef NTP_SUPPORT #define NTP_SUPPORT 1 // Scheduler needs NTP #endif - -// ----------------------------------------------------------------------------- -// WEB UI IMAGE -// ----------------------------------------------------------------------------- - -#define WEBUI_IMAGE_SMALL 0 -#define WEBUI_IMAGE_LIGHT 1 -#define WEBUI_IMAGE_SENSOR 2 -#define WEBUI_IMAGE_RFBRIDGE 4 -#define WEBUI_IMAGE_RFM69 8 -#define WEBUI_IMAGE_FULL 15 - -#if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE - #ifdef WEBUI_IMAGE - #undef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_FULL - #else - #define WEBUI_IMAGE WEBUI_IMAGE_LIGHT - #endif -#endif - -#if SENSOR_SUPPORT == 1 - #ifndef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_SENSOR - #else - #undef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_FULL - #endif -#endif - -#if defined(ITEAD_SONOFF_RFBRIDGE) - #ifndef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_RFBRIDGE - #else - #undef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_FULL - #endif -#endif - -#if RFM69_SUPPORT == 1 - #ifndef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_RFM69 - #else - #undef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_FULL - #endif -#endif - -#ifndef WEBUI_IMAGE - #define WEBUI_IMAGE WEBUI_IMAGE_SMALL -#endif diff --git a/code/espurna/config/webui.h b/code/espurna/config/webui.h new file mode 100644 index 00000000..c3b4dbc3 --- /dev/null +++ b/code/espurna/config/webui.h @@ -0,0 +1,50 @@ +// ----------------------------------------------------------------------------- +// WEB UI IMAGE +// ----------------------------------------------------------------------------- + +#define WEBUI_IMAGE_SMALL 0 +#define WEBUI_IMAGE_LIGHT 1 +#define WEBUI_IMAGE_SENSOR 2 +#define WEBUI_IMAGE_RFBRIDGE 4 +#define WEBUI_IMAGE_RFM69 8 +#define WEBUI_IMAGE_FULL 15 + +#if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE + #ifdef WEBUI_IMAGE + #undef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_FULL + #else + #define WEBUI_IMAGE WEBUI_IMAGE_LIGHT + #endif +#endif + +#if SENSOR_SUPPORT == 1 + #ifndef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_SENSOR + #else + #undef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_FULL + #endif +#endif + +#if defined(ITEAD_SONOFF_RFBRIDGE) + #ifndef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_RFBRIDGE + #else + #undef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_FULL + #endif +#endif + +#if RFM69_SUPPORT == 1 + #ifndef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_RFM69 + #else + #undef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_FULL + #endif +#endif + +#ifndef WEBUI_IMAGE + #define WEBUI_IMAGE WEBUI_IMAGE_SMALL +#endif