From f99f13a090581ea037850b167edbe15d3d0daf98 Mon Sep 17 00:00:00 2001 From: Travis J Dean Date: Sat, 28 Mar 2020 08:45:20 -0400 Subject: [PATCH] Avoid name collision. Fix wled instance access in ino. --- usermods/blynk_relay_control/wled06_usermod.ino | 2 +- usermods/stairway_wipe_basic/wled06_usermod.ino | 2 +- wled00/alexa.cpp | 2 +- wled00/button.cpp | 2 +- wled00/hue.cpp | 2 +- wled00/ir.cpp | 2 +- wled00/json.cpp | 2 +- wled00/led.cpp | 2 +- wled00/ntp.cpp | 4 +++- wled00/set.cpp | 2 +- wled00/usermod.cpp | 2 +- wled00/wled.cpp | 3 +-- wled00/wled00.ino | 6 ++---- wled00/{eeprom.cpp => wled_eeprom.cpp} | 3 ++- wled00/{eeprom.h => wled_eeprom.h} | 0 wled00/xml.cpp | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) rename wled00/{eeprom.cpp => wled_eeprom.cpp} (99%) rename wled00/{eeprom.h => wled_eeprom.h} (100%) diff --git a/usermods/blynk_relay_control/wled06_usermod.ino b/usermods/blynk_relay_control/wled06_usermod.ino index 1004b1ed..d4028ea5 100644 --- a/usermods/blynk_relay_control/wled06_usermod.ino +++ b/usermods/blynk_relay_control/wled06_usermod.ino @@ -1,7 +1,7 @@ /* * This file allows you to add own functionality to WLED more easily * See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality - * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled01_eeprom.h) + * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled_eeprom.h) * bytes 2400+ are currently ununsed, but might be used for future wled features */ diff --git a/usermods/stairway_wipe_basic/wled06_usermod.ino b/usermods/stairway_wipe_basic/wled06_usermod.ino index 3d493cc1..0cc85df7 100644 --- a/usermods/stairway_wipe_basic/wled06_usermod.ino +++ b/usermods/stairway_wipe_basic/wled06_usermod.ino @@ -1,7 +1,7 @@ /* * This file allows you to add own functionality to WLED more easily * See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality - * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled01_eeprom.h) + * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled_eeprom.h) * bytes 2400+ are currently ununsed, but might be used for future wled features */ diff --git a/wled00/alexa.cpp b/wled00/alexa.cpp index 621480d0..e35f5b35 100644 --- a/wled00/alexa.cpp +++ b/wled00/alexa.cpp @@ -2,7 +2,7 @@ #include "wled.h" #include "const.h" #include "led.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "colors.h" #ifndef WLED_DISABLE_ALEXA diff --git a/wled00/button.cpp b/wled00/button.cpp index 1afb54d5..a80061ee 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -1,7 +1,7 @@ #include "button.h" #include "wled.h" #include "led.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "set.h" /* diff --git a/wled00/hue.cpp b/wled00/hue.cpp index 484f2bd8..a186a314 100644 --- a/wled00/hue.cpp +++ b/wled00/hue.cpp @@ -1,7 +1,7 @@ #include "hue.h" #include "wled.h" #include "colors.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "notify.h" #include "led.h" diff --git a/wled00/ir.cpp b/wled00/ir.cpp index fcc0f5dd..32b0ee93 100644 --- a/wled00/ir.cpp +++ b/wled00/ir.cpp @@ -2,7 +2,7 @@ #include "wled.h" #include "led.h" #include "colors.h" -#include "eeprom.h" +#include "wled_eeprom.h" #if defined(WLED_DISABLE_INFRARED) void handleIR(){} diff --git a/wled00/json.cpp b/wled00/json.cpp index 73659e7e..6d71e414 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -1,6 +1,6 @@ #include "json.h" #include "wled.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "led.h" void deserializeSegment(JsonObject elem, byte it) diff --git a/wled00/led.cpp b/wled00/led.cpp index 4a16dcff..7f4d6309 100644 --- a/wled00/led.cpp +++ b/wled00/led.cpp @@ -2,7 +2,7 @@ #include "wled.h" #include "notify.h" #include "blynk.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "mqtt.h" #include "colors.h" diff --git a/wled00/ntp.cpp b/wled00/ntp.cpp index 3435760b..20663109 100644 --- a/wled00/ntp.cpp +++ b/wled00/ntp.cpp @@ -1,6 +1,8 @@ #include "ntp.h" +#include "src/dependencies/timezone/Timezone.h" #include "wled.h" -#include "eeprom.h" +#include "wled_eeprom.h" + TimeChangeRule UTCr = {Last, Sun, Mar, 1, 0}; // UTC Timezone tzUTC(UTCr, UTCr); diff --git a/wled00/set.cpp b/wled00/set.cpp index 1dfeb19d..0a7a4ff4 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -4,7 +4,7 @@ #include "hue.h" #include "led.h" #include "blynk.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "alexa.h" #include "cronixie.h" #include "xml.h" diff --git a/wled00/usermod.cpp b/wled00/usermod.cpp index c780ffee..6589c07c 100644 --- a/wled00/usermod.cpp +++ b/wled00/usermod.cpp @@ -2,7 +2,7 @@ /* * This file allows you to add own functionality to WLED more easily * See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality - * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled01_eeprom.h) + * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled01_wled_eeprom.h) * bytes 2400+ are currently ununsed, but might be used for future wled features */ diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 106f503b..2d474eb3 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -12,9 +12,8 @@ #include "blynk.h" #include "hue.h" #include "mqtt.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "server.h" -// replaced // Global Variable definitions char versionString[] = "0.9.1"; diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 522447d0..e3334837 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -3,12 +3,10 @@ */ #include "wled.h" -WLED& wled; void setup() { - wled = WLED::instance(); - wled.setup(); + WLED::instance().setup(); } void loop() { - wled.loop(); + WLED::instance().loop(); } \ No newline at end of file diff --git a/wled00/eeprom.cpp b/wled00/wled_eeprom.cpp similarity index 99% rename from wled00/eeprom.cpp rename to wled00/wled_eeprom.cpp index 68b8c35f..0087641a 100644 --- a/wled00/eeprom.cpp +++ b/wled00/wled_eeprom.cpp @@ -1,4 +1,5 @@ -#include "eeprom.h" +#include "wled_eeprom.h" +#include #include "wled.h" #include "cronixie.h" #include "ntp.h" diff --git a/wled00/eeprom.h b/wled00/wled_eeprom.h similarity index 100% rename from wled00/eeprom.h rename to wled00/wled_eeprom.h diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 930ab4b0..09e42011 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -1,6 +1,6 @@ #include "xml.h" #include "wled.h" -#include "eeprom.h" +#include "wled_eeprom.h" #include "ntp.h"