From df1f365c1e8b22b76371bc766fdf9c2f0317487e Mon Sep 17 00:00:00 2001 From: pmantoine Date: Sat, 29 Jun 2024 16:22:23 +0800 Subject: [PATCH] Add WIFI_LED option for ESP32, edits for config.example.h --- WifiESP32.cpp | 13 +++++++++++++ config.example.h | 14 ++++++++++++-- version.h | 5 ++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/WifiESP32.cpp b/WifiESP32.cpp index e45d0e8f..83dd2e15 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -147,6 +147,12 @@ bool WifiESP::setup(const char *SSid, // enableCoreWDT(1); // disableCoreWDT(0); +#ifdef WIFI_LED + // Turn off Wifi LED + pinMode(WIFI_LED, OUTPUT); + digitalWrite(WIFI_LED, 0); +#endif + // clean start WiFi.mode(WIFI_STA); WiFi.disconnect(true); @@ -247,6 +253,13 @@ bool WifiESP::setup(const char *SSid, // no idea to go on return false; } +#ifdef WIFI_LED + else{ + // Turn on Wifi connected LED + digitalWrite(WIFI_LED, 1); + } +#endif + // Now Wifi is up, register the mDNS service if(!MDNS.begin(hostname)) { diff --git a/config.example.h b/config.example.h index 3fc86c34..7c4e254d 100644 --- a/config.example.h +++ b/config.example.h @@ -307,11 +307,21 @@ The configuration file for DCC-EX Command Station // //#define SERIAL_BT_COMMANDS -// BOOSTER PIN INPUT ON ESP32 +// BOOSTER PIN INPUT ON ESP32 CS // On ESP32 you have the possibility to define a pin as booster input -// Arduio pin D2 is GPIO 26 on ESPDuino32 // +// Arduino pin D2 is GPIO 26 is Booster Input on ESPDuino32 //#define BOOSTER_INPUT 26 +// +// GPIO 32 is Booster Input on EX-CSB1 +//#define BOOSTER_INPUT 32 + +// ESP32 LED Wifi Indicator +// GPIO 2 on ESPduino32 +//#define WIFI_LED 2 +// +// GPIO 33 on EX-CSB1 +//#define WIFI_LED 33 // SABERTOOTH // diff --git a/version.h b/version.h index d91ff410..78bf0550 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,10 @@ #include "StringFormatter.h" -#define VERSION "5.2.62" +#define VERSION "5.2.63" +// 5.2.63 - Implement WIFI_LED for ESP32, ESPduino32 and EX-CSB1, that is turned on when STA mode connects or AP mode is up +// - Add BOOSTER_INPUT definitions for ESPduino32 and EX-CSB1 to config.example.h +// - Add WIFI_LED definitions for ESPduino32 and EX-CSB1 to config.example.h // 5.2.62 - Allow acks way longer than standard // 5.2.61 - Merg CBUS ACON/ACOF/ONACON/ONACOF Adapter interface. // - LCC Adapter interface throttled startup,