From 651294302f09d770cd673b1f291d667379d922a0 Mon Sep 17 00:00:00 2001 From: Stefan Kremser Date: Wed, 8 May 2019 18:37:16 +0200 Subject: [PATCH] Renamed MY92 defines --- esp8266_deauther/A_config.h | 38 +++++++++++++++++++++---------------- esp8266_deauther/LED.h | 28 +++++++++++++-------------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/esp8266_deauther/A_config.h b/esp8266_deauther/A_config.h index b89b7d7..5e87b7d 100644 --- a/esp8266_deauther/A_config.h +++ b/esp8266_deauther/A_config.h @@ -186,7 +186,16 @@ #define DEFAULT_SSID "pwned" #endif /* ifndef DEFAULT_SSID */ -// ===== LED ===== // +// =============== LED =============== // + +#if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) + #define NEOPIXEL_LED +#endif /* if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) */ + +#if !defined(LED_DIGITAL) && !defined(LED_RGB) && !defined(LED_NEOPIXEL) && !defined(MY92) + #define LED_DIGITAL +#endif /* if !defined(LED_DIGITAL) && !defined(LED_RGB) && !defined(LED_NEOPIXEL) && !defined(MY92) */ + #ifndef LED_PIN_R #define LED_PIN_R 255 #endif /* ifndef LED_PIN_R */ @@ -207,11 +216,8 @@ #define LED_MODE_BRIGHTNESS 10 #endif /* ifndef LED_MODE_BRIGHTNESS */ -#if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) - #define NEOPIXEL_LED -#endif /* if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) */ +// =============== DISPLAY =============== // -// ===== DISPLAY ===== // #ifndef DISPLAY_TEXT #define DISPLAY_TEXT "" #endif /* ifndef DISPLAY_TEXT */ @@ -251,7 +257,7 @@ #define SPI_CS 15 #endif /* ifndef SPI_CS */ -// ===== BUTTONS ===== // +// =============== BUTTONS =============== // #ifndef BUTTON_UP #define BUTTON_UP 255 #endif // ifndef BUTTON_UP @@ -277,7 +283,7 @@ #define LED_DIGITAL #define LED_RGB #define LED_NEOPIXEL - #define MY92 + #define LED_MY92 #define LED_ANODE false @@ -293,15 +299,15 @@ #define LED_MODE_BRIGHTNESS 100 - #define MY92_NUM 1 - #define MY92_DATA 4 - #define MY92_CLOCK 5 - #define MY92_CH_R 0 - #define MY92_CH_G 1 - #define MY92_CH_B 2 - #define MY92_CH_BRIGHTNESS 3 - #define MY92_MODEL MY92XX_MODEL_MY9291 - #define MY92_MODEL MY92XX_MODEL_MY9231 + #define LED_MY92_NUM 1 + #define LED_MY92_DATA 4 + #define LED_MY92_CLOCK 5 + #define LED_MY92_CH_R 0 + #define LED_MY92_CH_G 1 + #define LED_MY92_CH_B 2 + #define LED_MY92_CH_BRIGHTNESS 3 + #define LED_MY92_MODEL MY92XX_MODEL_MY9291 + #define LED_MY92_MODEL MY92XX_MODEL_MY9231 // ===== DISPLAY ===== // #define USE_DISPLAY false diff --git a/esp8266_deauther/LED.h b/esp8266_deauther/LED.h index 2e498bd..acec218 100644 --- a/esp8266_deauther/LED.h +++ b/esp8266_deauther/LED.h @@ -4,10 +4,10 @@ #include "Arduino.h" // digitalWrite, analogWrite, pinMode #include "A_config.h" // Config for LEDs -// Inlcude libraries for Neopixel or MY92xx if used +// Inlcude libraries for Neopixel or LED_MY92xx if used #if defined(NEOPIXEL_LED) #include -#elif defined(MY92) +#elif defined(LED_MY92) #include #endif // if defined(NEOPIXEL_LED) @@ -30,8 +30,8 @@ class LED { Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_RGB + NEO_KHZ400); #elif defined(LED_NEOPIXEL_GRB) Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ400); -#elif defined(MY92) - my92xx myled = my92xx(MY92_MODEL, MY92_NUM, MY92_DATA, MY92_CLK, MY92XX_COMMAND_DEFAULT); +#elif defined(LED_MY92) + my92xx myled = my92xx(LED_MY92_MODEL, LED_MY92_NUM, LED_MY92_DATA, LED_MY92_CLK, LED_MY92XX_COMMAND_DEFAULT); #endif // if defined(NEOPIXEL_LED) public: @@ -48,11 +48,11 @@ class LED { strip.begin(); strip.setBrightness(brightness); strip.show(); -#elif defined(MY9291) - myled.setChannel(MY92_CH_R, 0); - myled.setChannel(MY92_CH_G, 0); - myled.setChannel(MY92_CH_B, 0); - myled->setChannel(MY92_CH_BRIGHTNESS, brightness); +#elif defined(LED_MY9291) + myled.setChannel(LED_MY92_CH_R, 0); + myled.setChannel(LED_MY92_CH_G, 0); + myled.setChannel(LED_MY92_CH_B, 0); + myled->setChannel(LED_MY92_CH_BRIGHTNESS, brightness); myled->setChannel(3, 100); myled.setState(true); myled.update(); @@ -105,11 +105,11 @@ class LED { } strip.show(); -#elif defined(MY9291) - myled->setChannel(MY92_CH_R, r); - myled->setChannel(MY92_CH_G, g); - myled->setChannel(MY92_CH_B, b); - myled->setChannel(MY92_CH_BRIGHTNESS, brightness); +#elif defined(LED_MY9291) + myled->setChannel(LED_MY92_CH_R, r); + myled->setChannel(LED_MY92_CH_G, g); + myled->setChannel(LED_MY92_CH_B, b); + myled->setChannel(LED_MY92_CH_BRIGHTNESS, brightness); myled->setState(true); myled->update(); #endif // if defined(LED_DIGITAL)