Skip to content

Commit

Permalink
Add WIFI_LED option for ESP32, edits for config.example.h
Browse files Browse the repository at this point in the history
  • Loading branch information
pmantoine committed Jun 29, 2024
1 parent 023c004 commit df1f365
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
13 changes: 13 additions & 0 deletions WifiESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down
14 changes: 12 additions & 2 deletions config.example.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
5 changes: 4 additions & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit df1f365

Please sign in to comment.