diff --git a/wled00/src/dependencies/espalexa/EspalexaDevice.h b/wled00/src/dependencies/espalexa/EspalexaDevice.h index 4785591f..b964e0e3 100644 --- a/wled00/src/dependencies/espalexa/EspalexaDevice.h +++ b/wled00/src/dependencies/espalexa/EspalexaDevice.h @@ -1,6 +1,6 @@ #ifndef EspalexaDevice_h #define EspalexaDevice_h - +#include #include "Arduino.h" typedef class EspalexaDevice; diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 50a83f27..97ed3878 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -1,4 +1,18 @@ #include "wled.h" +#include "wled_led.h" +#include "wled_ir.h" +#include "wled_notify.h" +#include "wled_alexa.h" +#include "wled_overlay.h" +#include "wled_file.h" +#include "wled_button.h" +#include "wled_ntp.h" +#include "wled_usermod.h" +#include "wled_blynk.h" +#include "wled_hue.h" +#include "wled_mqtt.h" +#include "wled_eeprom.h" +#include "wled_server.h" WLED::WLED() { @@ -251,7 +265,7 @@ void WLED::beginStrip() #endif } -void WLED::initAP(bool resetAP = false) +void WLED::initAP(bool resetAP) { if (apBehavior == AP_BEHAVIOR_BUTTON_ONLY && !resetAP) return; @@ -483,7 +497,7 @@ void WLED::handleConnection() } //by https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp -int WLED::getSignalQuality(int rssi) +int getSignalQuality(int rssi) { int quality = 0; diff --git a/wled00/wled.h b/wled00/wled.h index 4f9b79af..8ef30cbf 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -491,6 +491,7 @@ int loops = 0; bool oappend(const char *txt); //append new number to temp buffer efficiently bool oappendi(int i); +int getSignalQuality(int rssi); class WLED { @@ -503,8 +504,6 @@ public: WLED(); - void wledInit(); - void reset(); void loop(); @@ -515,8 +514,6 @@ public: wledInit(); } - void loop(); - private: void wledInit(); void beginStrip(); diff --git a/wled00/wled00.ino b/wled00/wled00.ino index fc06f211..ac993bf6 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -3,11 +3,11 @@ */ #include "wled.h" +WLED wled; void setup() { - //auto& wled = Wled(); + wled.instance(); // Force creation of static instance } void loop() { - - + wled.loop(); } \ No newline at end of file diff --git a/wled00/wled_alexa.cpp b/wled00/wled_alexa.cpp index b68843cb..ce63a019 100644 --- a/wled00/wled_alexa.cpp +++ b/wled00/wled_alexa.cpp @@ -1,6 +1,7 @@ #include "wled_alexa.h" #include "wled.h" #include "src/dependencies/espalexa/EspalexaDevice.h" +#include "const.h" #ifndef WLED_DISABLE_ALEXA void onAlexaChange(EspalexaDevice* dev); diff --git a/wled00/wled_alexa.h b/wled00/wled_alexa.h index 4bf7bd12..94ad0342 100644 --- a/wled00/wled_alexa.h +++ b/wled00/wled_alexa.h @@ -7,10 +7,11 @@ * https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch * https://github.com/probonopd/ESP8266HueEmulator */ -class EspalexaDevice; +#include "src/dependencies/espalexa/EspalexaDevice.h" + void onAlexaChange(EspalexaDevice* dev); void alexaInit(); void handleAlexa(); void onAlexaChange(EspalexaDevice* dev); -#define WLED_ALEXA_H \ No newline at end of file +#endif // WLED_ALEXA_H \ No newline at end of file diff --git a/wled00/wled_eeprom.cpp b/wled00/wled_eeprom.cpp index 0ddbf57f..1e2b0e62 100644 --- a/wled00/wled_eeprom.cpp +++ b/wled00/wled_eeprom.cpp @@ -1,7 +1,10 @@ #include "wled_eeprom.h" #include "wled.h" +#include "wled_cronixie.h" +#include "wled_ntp.h" +#include "wled_set.h" +#include "wled_led.h" -#define EEPSIZE 2560 //Maximum is 4096 //eeprom Version code, enables default settings instead of 0 init on update #define EEPVER 18 diff --git a/wled00/wled_eeprom.h b/wled00/wled_eeprom.h index fe5c2cbf..19f61925 100644 --- a/wled00/wled_eeprom.h +++ b/wled00/wled_eeprom.h @@ -5,6 +5,7 @@ * Methods to handle saving and loading to non-volatile memory * EEPROM Map: https://github.com/Aircoookie/WLED/wiki/EEPROM-Map */ +#define EEPSIZE 2560 //Maximum is 4096 void commit(); void clearEEPROM(); diff --git a/wled00/wled_file.cpp b/wled00/wled_file.cpp index 700d66ee..81b86d6d 100644 --- a/wled00/wled_file.cpp +++ b/wled00/wled_file.cpp @@ -1,5 +1,8 @@ #include "wled_file.h" #include "wled.h" +#include "wled_led.h" +#include "wled_notify.h" + //filesystem #ifndef WLED_DISABLE_FILESYSTEM #include @@ -21,6 +24,7 @@ enum class AdaState { Data_Blue }; +// Maybe Adalight should not be in filehandling? TODO void handleSerial() { #ifdef WLED_ENABLE_ADALIGHT diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index c73e027f..542abea4 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -1,5 +1,10 @@ #include "wled_server.h" #include "wled.h" +#include "wled_file.h" +#include "wled_set.h" +#include "wled_json.h" +#include "wled_xml.h" + //Is this an IP? bool isIp(String str) { diff --git a/wled00/wled_server.h b/wled00/wled_server.h index 08679e17..a03f83e1 100644 --- a/wled00/wled_server.h +++ b/wled00/wled_server.h @@ -1,5 +1,6 @@ #ifndef WLED_SERVER_H #define WLED_SERVER_H +#include /* * Server page declarations */ diff --git a/wled00/wled_set.cpp b/wled00/wled_set.cpp index d81cac91..aff3f0cd 100644 --- a/wled00/wled_set.cpp +++ b/wled00/wled_set.cpp @@ -1,10 +1,13 @@ #include "wled_set.h" #include "wled.h" -#include "wled_hue.h" #include "wled_colors.h" -/* - * Receives client input - */ +#include "wled_hue.h" +#include "wled_led.h" +#include "wled_blynk.h" +#include "wled_eeprom.h" +#include "wled_alexa.h" +#include "wled_cronixie.h" +#include "wled_xml.h" void _setRandomColor(bool _sec,bool fromButton=false) { diff --git a/wled00/wled_set.h b/wled00/wled_set.h index 7efde0d7..ebee8c92 100644 --- a/wled00/wled_set.h +++ b/wled00/wled_set.h @@ -2,10 +2,14 @@ #define WLED_SET_H #include #include +/* + * Receives client input + */ void _setRandomColor(bool _sec,bool fromButton=false); bool isAsterisksOnly(const char* str, byte maxLen); void handleSettingsSet(AsyncWebServerRequest *request, byte subPage); +bool handleSet(AsyncWebServerRequest *request, const String& req); int getNumVal(const String* req, uint16_t pos); bool updateVal(const String* req, const char* key, byte* val, byte minv=0, byte maxv=255); diff --git a/wled00/wled06_usermod.cpp b/wled00/wled_usermod.cpp similarity index 100% rename from wled00/wled06_usermod.cpp rename to wled00/wled_usermod.cpp diff --git a/wled00/wled_usermod.h b/wled00/wled_usermod.h new file mode 100644 index 00000000..61ef6b78 --- /dev/null +++ b/wled00/wled_usermod.h @@ -0,0 +1,8 @@ +#ifndef WLED_USERMOD_H +#define WLED_USERMOD_H + +void userSetup(); +void userConnected(); +void userLoop(); + +#endif // WLED_USERMOD_H \ No newline at end of file