Skip to content

Commit

Permalink
Prior to refactoring includes and forward definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisDean committed Mar 25, 2020
1 parent 594c0b8 commit 1213176
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 17 deletions.
2 changes: 1 addition & 1 deletion wled00/src/dependencies/espalexa/EspalexaDevice.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef EspalexaDevice_h
#define EspalexaDevice_h

#include <functional>
#include "Arduino.h"

typedef class EspalexaDevice;
Expand Down
18 changes: 16 additions & 2 deletions wled00/wled.cpp
Original file line number Diff line number Diff line change
@@ -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() {

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
5 changes: 1 addition & 4 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -503,8 +504,6 @@ class WLED

WLED();

void wledInit();

void reset();
void loop();

Expand All @@ -515,8 +514,6 @@ class WLED
wledInit();
}

void loop();

private:
void wledInit();
void beginStrip();
Expand Down
6 changes: 3 additions & 3 deletions wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
1 change: 1 addition & 0 deletions wled00/wled_alexa.cpp
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
5 changes: 3 additions & 2 deletions wled00/wled_alexa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion wled00/wled_eeprom.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions wled00/wled_eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions wled00/wled_file.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -21,6 +24,7 @@ enum class AdaState {
Data_Blue
};

// Maybe Adalight should not be in filehandling? TODO
void handleSerial()
{
#ifdef WLED_ENABLE_ADALIGHT
Expand Down
5 changes: 5 additions & 0 deletions wled00/wled_server.cpp
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
1 change: 1 addition & 0 deletions wled00/wled_server.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef WLED_SERVER_H
#define WLED_SERVER_H
#include <Arduino.h>
/*
* Server page declarations
*/
Expand Down
11 changes: 7 additions & 4 deletions wled00/wled_set.cpp
Original file line number Diff line number Diff line change
@@ -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)
{
Expand Down
4 changes: 4 additions & 0 deletions wled00/wled_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions wled00/wled_usermod.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef WLED_USERMOD_H
#define WLED_USERMOD_H

void userSetup();
void userConnected();
void userLoop();

#endif // WLED_USERMOD_H

0 comments on commit 1213176

Please sign in to comment.