@@ -598,6 +598,10 @@ class ESPAsync_WiFiManager_Lite
598
598
599
599
// ////////////////////////////////////////
600
600
601
+ #if !defined(USE_LED_BUILTIN)
602
+ #define USE_LED_BUILTIN true // use builtin LED to show configuration mode
603
+ #endif
604
+
601
605
#if ESP8266
602
606
603
607
// For ESP8266
@@ -633,10 +637,12 @@ class ESPAsync_WiFiManager_Lite
633
637
{
634
638
#define TIMEOUT_CONNECT_WIFI 30000
635
639
640
+ #if USE_LED_BUILTIN
636
641
// Turn OFF
637
642
pinMode (LED_BUILTIN, OUTPUT);
638
643
digitalWrite (LED_BUILTIN, LED_OFF);
639
-
644
+ #endif
645
+
640
646
#if USING_MRD
641
647
// // New MRD ////
642
648
mrd = new MultiResetDetector (MRD_TIMEOUT, MRD_ADDRESS);
@@ -891,9 +897,10 @@ class ESPAsync_WiFiManager_Lite
891
897
892
898
if (connectMultiWiFi () == WL_CONNECTED)
893
899
{
900
+ #if USE_LED_BUILTIN
894
901
// turn the LED_BUILTIN OFF to tell us we exit configuration mode.
895
902
digitalWrite (LED_BUILTIN, LED_OFF);
896
-
903
+ # endif
897
904
ESP_WML_LOGINFO (F (" run: WiFi reconnected" ));
898
905
}
899
906
}
@@ -902,9 +909,10 @@ class ESPAsync_WiFiManager_Lite
902
909
903
910
if (connectMultiWiFi () == WL_CONNECTED)
904
911
{
912
+ #if USE_LED_BUILTIN
905
913
// turn the LED_BUILTIN OFF to tell us we exit configuration mode.
906
914
digitalWrite (LED_BUILTIN, LED_OFF);
907
-
915
+ # endif
908
916
ESP_WML_LOGINFO (F (" run: WiFi reconnected" ));
909
917
}
910
918
#endif
@@ -918,8 +926,10 @@ class ESPAsync_WiFiManager_Lite
918
926
{
919
927
configuration_mode = false ;
920
928
ESP_WML_LOGINFO (F (" run: got WiFi back" ));
929
+ #if USE_LED_BUILTIN
921
930
// turn the LED_BUILTIN OFF to tell us we exit configuration mode.
922
931
digitalWrite (LED_BUILTIN, LED_OFF);
932
+ #endif
923
933
}
924
934
}
925
935
@@ -2852,10 +2862,11 @@ class ESPAsync_WiFiManager_Lite
2852
2862
2853
2863
WiFiNetworksFound = scanWifiNetworks (&indices);
2854
2864
#endif
2855
-
2865
+
2866
+ #if USE_LED_BUILTIN
2856
2867
// turn the LED_BUILTIN ON to tell us we are in configuration mode.
2857
2868
digitalWrite (LED_BUILTIN, LED_ON);
2858
-
2869
+ # endif
2859
2870
if ( (portal_ssid == " " ) || portal_pass == " " )
2860
2871
{
2861
2872
String chipID = String (ESP_getChipId (), HEX);
0 commit comments