Code reorg.

This commit is contained in:
Travis J Dean 2020-03-30 04:35:52 -04:00
parent 408d63825a
commit de63bdac39
2 changed files with 4 additions and 18 deletions

View File

@ -356,23 +356,14 @@ WS2812FX strip = WS2812FX();
#define WLED_CONNECTED (WiFi.status() == WL_CONNECTED) #define WLED_CONNECTED (WiFi.status() == WL_CONNECTED)
#define WLED_WIFI_CONFIGURED (strlen(clientSSID) >= 1 && strcmp(clientSSID, DEFAULT_CLIENT_SSID) != 0) #define WLED_WIFI_CONFIGURED (strlen(clientSSID) >= 1 && strcmp(clientSSID, DEFAULT_CLIENT_SSID) != 0)
//debug macros //debug macro variable definitions
#ifdef WLED_DEBUG #ifdef WLED_DEBUG
#define DEBUG_PRINT(x) Serial.print(x)
#define DEBUG_PRINTLN(x) Serial.println(x)
#define DEBUG_PRINTF(x) Serial.printf(x)
unsigned long debugTime = 0; unsigned long debugTime = 0;
int lastWifiState = 3; int lastWifiState = 3;
unsigned long wifiStateChangedTime = 0; unsigned long wifiStateChangedTime = 0;
int loops = 0; int loops = 0;
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTLN(x)
#define DEBUG_PRINTF(x)
#endif #endif
WLED::WLED() { WLED::WLED() {
} }

View File

@ -381,28 +381,23 @@ int getSignalQuality(int rssi);
class WLED class WLED
{ {
public: public:
WLED();
static WLED &instance() static WLED &instance()
{ {
static WLED instance; static WLED instance;
return instance; return instance;
} }
WLED();
void reset();
void loop();
//boot starts here //boot starts here
void setup() void setup()
{ {
wledInit(); wledInit();
} }
void loop();
void reset();
public: // TODO: privacy
void wledInit(); void wledInit();
void beginStrip(); void beginStrip();
void handleConnection(); void handleConnection();
void initAP(bool resetAP = false); void initAP(bool resetAP = false);
void initConnection(); void initConnection();