Per default don't use TRIGGER_GPIO (#633)
and move SLEEP_BUTTON definition to config_M5 as it is only used for the moment with M5 stack and stickc boards
This commit is contained in:
1 parent
ae342f4a32
commit
afa3010033
4 files changed
+14
-10
No files matched your search
+2
-7
@@ -120,9 +120,6 @@ char gateway_name[parameters_size * 2] = Gateway_Name;
|
|||||||
//DEFAULT_LOW_POWER_MODE 1 to activate deep sleep with LCD ON when a function is processing,
|
//DEFAULT_LOW_POWER_MODE 1 to activate deep sleep with LCD ON when a function is processing,
|
||||||
//DEFAULT_LOW_POWER_MODE 2 to activate deep sleep with LED ON when a function is processing (LCD is turned OFF)
|
//DEFAULT_LOW_POWER_MODE 2 to activate deep sleep with LED ON when a function is processing (LCD is turned OFF)
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
# ifndef SLEEP_BUTTON
|
|
||||||
# define SLEEP_BUTTON 33
|
|
||||||
# endif
|
|
||||||
# ifndef DEFAULT_LOW_POWER_MODE
|
# ifndef DEFAULT_LOW_POWER_MODE
|
||||||
# define DEFAULT_LOW_POWER_MODE 0
|
# define DEFAULT_LOW_POWER_MODE 0
|
||||||
# endif
|
# endif
|
||||||
@@ -240,12 +237,10 @@ uint8_t wifiProtocol = 0; // default mode, automatic selection
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TRIGGER_GPIO
|
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
|
//# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
|
||||||
#elif ESP32
|
#elif ESP32
|
||||||
# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
|
//# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// VCC ------------D|-----------/\/\/\/\ ----------------- Arduino PIN
|
// VCC ------------D|-----------/\/\/\/\ ----------------- Arduino PIN
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ extern void loopM5();
|
|||||||
#ifndef NORMAL_LCD_BRIGHTNESS
|
#ifndef NORMAL_LCD_BRIGHTNESS
|
||||||
# define NORMAL_LCD_BRIGHTNESS 100 // 0 to 100
|
# define NORMAL_LCD_BRIGHTNESS 100 // 0 to 100
|
||||||
#endif
|
#endif
|
||||||
|
/*---------------DEFINE SLEEP BUTTON------------------*/
|
||||||
|
#ifndef SLEEP_BUTTON
|
||||||
|
# define SLEEP_BUTTON 33
|
||||||
|
#endif
|
||||||
/*-------------------DEFINE LOG LEVEL----------------------*/
|
/*-------------------DEFINE LOG LEVEL----------------------*/
|
||||||
#define LOG_LEVEL_LCD LOG_LEVEL_WARNING // if we go down below warning the size of the text to display can make the M5 restarting
|
#define LOG_LEVEL_LCD LOG_LEVEL_WARNING // if we go down below warning the size of the text to display can make the M5 restarting
|
||||||
#define LOG_TO_LCD true //set to false if you want to use serial monitor for the log per default instead of the M5 screen
|
#define LOG_TO_LCD true //set to false if you want to use serial monitor for the log per default instead of the M5 screen
|
||||||
|
|||||||
+6
-1
@@ -774,6 +774,7 @@ void saveConfigCallback() {
|
|||||||
shouldSaveConfig = true;
|
shouldSaveConfig = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if TRIGGER_GPIO
|
||||||
void checkButton() { // code from tzapu/wifimanager examples
|
void checkButton() { // code from tzapu/wifimanager examples
|
||||||
// check for button press
|
// check for button press
|
||||||
if (digitalRead(TRIGGER_GPIO) == LOW) {
|
if (digitalRead(TRIGGER_GPIO) == LOW) {
|
||||||
@@ -791,6 +792,9 @@ void checkButton() { // code from tzapu/wifimanager examples
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# else
|
||||||
|
void checkButton() {}
|
||||||
|
# endif
|
||||||
|
|
||||||
void eraseAndRestart() {
|
void eraseAndRestart() {
|
||||||
# if defined(ESP8266)
|
# if defined(ESP8266)
|
||||||
@@ -811,8 +815,9 @@ void eraseAndRestart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup_wifimanager(bool reset_settings) {
|
void setup_wifimanager(bool reset_settings) {
|
||||||
|
# if TRIGGER_GPIO
|
||||||
pinMode(TRIGGER_GPIO, INPUT_PULLUP);
|
pinMode(TRIGGER_GPIO, INPUT_PULLUP);
|
||||||
|
# endif
|
||||||
delay(10);
|
delay(10);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
if (!wifiProtocol) forceWifiProtocol();
|
if (!wifiProtocol) forceWifiProtocol();
|
||||||
|
|||||||
+2
-2
@@ -136,9 +136,9 @@ char gateway_name[parameters_size * 2] = Gateway_Name;
|
|||||||
// LED Resistor 270-510R
|
// LED Resistor 270-510R
|
||||||
#ifndef TRIGGER_GPIO
|
#ifndef TRIGGER_GPIO
|
||||||
# ifdef ESP8266
|
# ifdef ESP8266
|
||||||
# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
|
//# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
|
||||||
# elif ESP32
|
# elif ESP32
|
||||||
# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
|
//# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user