Prior to refactoring includes and forward definitions.

This commit is contained in:
Travis J Dean 2020-03-25 04:36:55 -04:00
parent 594c0b8550
commit 12131764d1
15 changed files with 59 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#ifndef EspalexaDevice_h
#define EspalexaDevice_h
#include <functional>
#include "Arduino.h"
typedef class EspalexaDevice;

View File

@ -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;

View File

@ -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();

View File

@ -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();
}

View File

@ -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);

View File

@ -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
#endif // WLED_ALEXA_H

View File

@ -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

View File

@ -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();

View File

@ -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 <FS.h>
@ -21,6 +24,7 @@ enum class AdaState {
Data_Blue
};
// Maybe Adalight should not be in filehandling? TODO
void handleSerial()
{
#ifdef WLED_ENABLE_ADALIGHT

View File

@ -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) {

View File

@ -1,5 +1,6 @@
#ifndef WLED_SERVER_H
#define WLED_SERVER_H
#include <Arduino.h>
/*
* Server page declarations
*/

View File

@ -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)
{

View File

@ -2,10 +2,14 @@
#define WLED_SET_H
#include <Arduino.h>
#include <ESPAsyncWebServer.h>
/*
* 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);

8
wled00/wled_usermod.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef WLED_USERMOD_H
#define WLED_USERMOD_H
void userSetup();
void userConnected();
void userLoop();
#endif // WLED_USERMOD_H