From 730ba12c8dc1421cec7983c27728210e2f196fc9 Mon Sep 17 00:00:00 2001 From: Def3nder Date: Mon, 24 Feb 2020 22:09:33 +0100 Subject: [PATCH] Indents for the #ifdef's in wled00.ino (#716) --- wled00/wled00.ino | 117 +++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 66a17eea28..c147dca34e 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -36,22 +36,22 @@ //library inclusions #include #ifdef WLED_ENABLE_DMX -#include -DMXESPSerial dmx; + #include + DMXESPSerial dmx; #endif #ifdef ESP8266 - #include - #include - #include - extern "C" { - #include - } -#else -#include -#include "esp_wifi.h" -#include -#include -#include "SPIFFS.h" + #include + #include + #include + extern "C" { + #include + } +#else //ESP32 + #include + #include "esp_wifi.h" + #include + #include + #include "SPIFFS.h" #endif #include @@ -59,20 +59,20 @@ DMXESPSerial dmx; #include #include #ifndef WLED_DISABLE_OTA -#include + #include #endif #include #include "src/dependencies/time/TimeLib.h" #include "src/dependencies/timezone/Timezone.h" #ifndef WLED_DISABLE_ALEXA -#define ESPALEXA_ASYNC -#define ESPALEXA_NO_SUBPAGE -#define ESPALEXA_MAXDEVICES 1 -//#define ESPALEXA_DEBUG -#include "src/dependencies/espalexa/Espalexa.h" + #define ESPALEXA_ASYNC + #define ESPALEXA_NO_SUBPAGE + #define ESPALEXA_MAXDEVICES 1 + // #define ESPALEXA_DEBUG + #include "src/dependencies/espalexa/Espalexa.h" #endif #ifndef WLED_DISABLE_BLYNK -#include "src/dependencies/blynk/BlynkSimpleEsp.h" + #include "src/dependencies/blynk/BlynkSimpleEsp.h" #endif #include "src/dependencies/e131/ESPAsyncE131.h" #include "src/dependencies/async-mqtt-client/AsyncMqttClient.h" @@ -95,15 +95,15 @@ DMXESPSerial dmx; #if IR_PIN < 0 -#ifndef WLED_DISABLE_INFRARED -#define WLED_DISABLE_INFRARED -#endif + #ifndef WLED_DISABLE_INFRARED + #define WLED_DISABLE_INFRARED + #endif #endif #ifndef WLED_DISABLE_INFRARED -#include -#include -#include + #include + #include + #include #endif // remove flicker because PWM signal of RGB channels can become out of phase @@ -270,12 +270,12 @@ bool aOtaEnabled = true; //ArduinoOTA allows easy updates d uint16_t userVar0 = 0, userVar1 = 0; #ifdef WLED_ENABLE_DMX -//dmx CONFIG -byte DMXChannels = 7; // number of channels per fixture -byte DMXFixtureMap[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + //dmx CONFIG + byte DMXChannels = 7; // number of channels per fixture + byte DMXFixtureMap[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // assigns the different channels to different functions. See wled21_dmx.ino for more information. -uint16_t DMXGap = 10; // gap between the fixtures. makes addressing easier because you don't have to memorize odd numbers when climbing up onto a rig. -uint16_t DMXStart = 10; // start address of the first fixture + uint16_t DMXGap = 10; // gap between the fixtures. makes addressing easier because you don't have to memorize odd numbers when climbing up onto a rig. + uint16_t DMXStart = 10; // start address of the first fixture #endif @@ -398,7 +398,6 @@ byte realtimeMode = REALTIME_MODE_INACTIVE; IPAddress realtimeIP = (0,0,0,0); unsigned long realtimeTimeout = 0; - //mqtt long lastMqttReconnectAttempt = 0; long lastInterfaceUpdate = 0; @@ -406,17 +405,17 @@ byte interfaceUpdateCallMode = NOTIFIER_CALL_MODE_INIT; char mqttStatusTopic[40] = ""; //this must be global because of async handlers #if AUXPIN >= 0 -//auxiliary debug pin -byte auxTime = 0; -unsigned long auxStartTime = 0; -bool auxActive = false, auxActiveBefore = false; + //auxiliary debug pin + byte auxTime = 0; + unsigned long auxStartTime = 0; + bool auxActive = false, auxActiveBefore = false; #endif //alexa udp String escapedMac; #ifndef WLED_DISABLE_ALEXA -Espalexa espalexa; -EspalexaDevice* espalexaDevice; + Espalexa espalexa; + EspalexaDevice* espalexaDevice; #endif //dns server @@ -431,6 +430,7 @@ IPAddress ntpServerIP; uint16_t ntpLocalPort = 2390; #define NTP_PACKET_SIZE 48 +//maximum number of LEDs - MAX_LEDS is comming from the JSON response getting too big, MAX_LEDS_DMA will become a timing issue #define MAX_LEDS 1500 #define MAX_LEDS_DMA 500 @@ -439,6 +439,7 @@ uint16_t ntpLocalPort = 2390; char* obuf; uint16_t olen = 0; +//presets uint16_t savedPresets = 0; int8_t currentPreset = -1; bool isPreset = false; @@ -479,26 +480,26 @@ WS2812FX strip = WS2812FX(); //debug macros #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; -int lastWifiState = 3; -unsigned long wifiStateChangedTime = 0; -int loops = 0; + #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; + int lastWifiState = 3; + unsigned long wifiStateChangedTime = 0; + int loops = 0; #else -#define DEBUG_PRINT(x) -#define DEBUG_PRINTLN(x) -#define DEBUG_PRINTF(x) + #define DEBUG_PRINT(x) + #define DEBUG_PRINTLN(x) + #define DEBUG_PRINTF(x) #endif //filesystem #ifndef WLED_DISABLE_FILESYSTEM -#include -#ifdef ARDUINO_ARCH_ESP32 -#include "SPIFFS.h" -#endif -#include "SPIFFSEditor.h" + #include + #ifdef ARDUINO_ARCH_ESP32 + #include "SPIFFS.h" + #endif + #include "SPIFFSEditor.h" #endif @@ -564,9 +565,9 @@ void loop() { handleOverlays(); yield(); - #ifdef WLED_USE_ANALOG_LEDS +#ifdef WLED_USE_ANALOG_LEDS strip.setRgbwPwm(); - #endif +#endif if (doReboot) reset(); @@ -586,9 +587,9 @@ void loop() { if (!offMode) strip.service(); } yield(); - #ifdef ESP8266 +#ifdef ESP8266 MDNS.update(); - #endif +#endif if (millis() - lastMqttReconnectAttempt > 30000) initMqtt(); //DEBUG serial logging