Implement error LED and status codes. (#1006)

Merges LED_RECEIVE/LED_SEND into LED_SEND_RECEIVE pin definition.

Adds LED_ERROR to display error status based on blink times as follows:

Disconnected from Wifi: 2 seconds on 2 seconds off.
Disconnected from broker: 2 seconds on 5 seconds off.

Other status LED indications added:
WifiManager configuration web portal active: LED_INFO and LED_SEND_RECEIVE = ON.
OTA Update in progress: LED_SEND_RECIEVE and LED_ERROR = ON.
This commit is contained in:
h2zero authored and GitHub committed 2021-07-01 13:24:20 -05:00
1 parent 76f880dc15
commit 05dddf42de
2 files changed
+48 -34

No files matched your search

+14 -14
View File
@@ -334,33 +334,33 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
#endif
/*-------------DEFINE PINs FOR STATUS LEDs----------------*/
#ifndef LED_RECEIVE
#ifndef LED_SEND_RECEIVE
# ifdef ESP8266
# define LED_RECEIVE 40
# define LED_SEND_RECEIVE 40
# elif ESP32
# define LED_RECEIVE 40
# define LED_SEND_RECEIVE 40
# elif __AVR_ATmega2560__ //arduino mega
# define LED_RECEIVE 40
# define LED_SEND_RECEIVE 40
# else //arduino uno/nano
# define LED_RECEIVE 40
# define LED_SEND_RECEIVE 40
# endif
#endif
#ifndef LED_RECEIVE_ON
# define LED_RECEIVE_ON HIGH
#ifndef LED_SEND_RECEIVE_ON
# define LED_SEND_RECEIVE_ON HIGH
#endif
#ifndef LED_SEND
#ifndef LED_ERROR
# ifdef ESP8266
# define LED_SEND 42
# define LED_ERROR 42
# elif ESP32
# define LED_SEND 42
# define LED_ERROR 42
# elif __AVR_ATmega2560__ //arduino mega
# define LED_SEND 42
# define LED_ERROR 42
# else //arduino uno/nano
# define LED_SEND 42
# define LED_ERROR 42
# endif
#endif
#ifndef LED_SEND_ON
# define LED_SEND_ON HIGH
#ifndef LED_ERROR_ON
# define LED_ERROR_ON HIGH
#endif
#ifndef LED_INFO
# ifdef ESP8266