Skip to content

Commit

Permalink
Indents for the #ifdef's in wled00.ino (Aircoookie#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
Def3nder authored Feb 24, 2020
1 parent 2d75526 commit 730ba12
Showing 1 changed file with 59 additions and 58 deletions.
117 changes: 59 additions & 58 deletions wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,43 @@
//library inclusions
#include <Arduino.h>
#ifdef WLED_ENABLE_DMX
#include <ESPDMX.h>
DMXESPSerial dmx;
#include <ESPDMX.h>
DMXESPSerial dmx;
#endif
#ifdef ESP8266
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ESPAsyncTCP.h>
extern "C" {
#include <user_interface.h>
}
#else
#include <WiFi.h>
#include "esp_wifi.h"
#include <ESPmDNS.h>
#include <AsyncTCP.h>
#include "SPIFFS.h"
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ESPAsyncTCP.h>
extern "C" {
#include <user_interface.h>
}
#else //ESP32
#include <WiFi.h>
#include "esp_wifi.h"
#include <ESPmDNS.h>
#include <AsyncTCP.h>
#include "SPIFFS.h"
#endif

#include <ESPAsyncWebServer.h>
#include <EEPROM.h>
#include <WiFiUdp.h>
#include <DNSServer.h>
#ifndef WLED_DISABLE_OTA
#include <ArduinoOTA.h>
#include <ArduinoOTA.h>
#endif
#include <SPIFFSEditor.h>
#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"
Expand All @@ -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 <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>
#endif

// remove flicker because PWM signal of RGB channels can become out of phase
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -398,25 +398,24 @@ byte realtimeMode = REALTIME_MODE_INACTIVE;
IPAddress realtimeIP = (0,0,0,0);
unsigned long realtimeTimeout = 0;


//mqtt
long lastMqttReconnectAttempt = 0;
long lastInterfaceUpdate = 0;
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
Expand All @@ -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

Expand All @@ -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;
Expand Down Expand Up @@ -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 <FS.h>
#ifdef ARDUINO_ARCH_ESP32
#include "SPIFFS.h"
#endif
#include "SPIFFSEditor.h"
#include <FS.h>
#ifdef ARDUINO_ARCH_ESP32
#include "SPIFFS.h"
#endif
#include "SPIFFSEditor.h"
#endif


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

Expand All @@ -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
Expand Down

0 comments on commit 730ba12

Please sign in to comment.