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:
Florian authored and GitHub committed 2020-06-14 07:53:00 -05:00
1 parent ae342f4a32
commit afa3010033
4 files changed
+16 -12

No files matched your search

+4 -9
View File
@@ -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 2 to activate deep sleep with LED ON when a function is processing (LCD is turned OFF)
#ifdef ESP32
# ifndef SLEEP_BUTTON
# define SLEEP_BUTTON 33
# endif
# ifndef DEFAULT_LOW_POWER_MODE
# define DEFAULT_LOW_POWER_MODE 0
# endif
@@ -240,12 +237,10 @@ uint8_t wifiProtocol = 0; // default mode, automatic selection
# endif
#endif
#ifndef TRIGGER_GPIO
# ifdef ESP8266
# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
# elif ESP32
# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
# endif
#ifdef ESP8266
//# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
#elif ESP32
//# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
#endif
// VCC ------------D|-----------/\/\/\/\ ----------------- Arduino PIN
+4
View File
@@ -43,6 +43,10 @@ extern void loopM5();
#ifndef NORMAL_LCD_BRIGHTNESS
# define NORMAL_LCD_BRIGHTNESS 100 // 0 to 100
#endif
/*---------------DEFINE SLEEP BUTTON------------------*/
#ifndef SLEEP_BUTTON
# define SLEEP_BUTTON 33
#endif
/*-------------------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_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
View File
@@ -774,6 +774,7 @@ void saveConfigCallback() {
shouldSaveConfig = true;
}
# if TRIGGER_GPIO
void checkButton() { // code from tzapu/wifimanager examples
// check for button press
if (digitalRead(TRIGGER_GPIO) == LOW) {
@@ -791,6 +792,9 @@ void checkButton() { // code from tzapu/wifimanager examples
}
}
}
# else
void checkButton() {}
# endif
void eraseAndRestart() {
# if defined(ESP8266)
@@ -811,8 +815,9 @@ void eraseAndRestart() {
}
void setup_wifimanager(bool reset_settings) {
# if TRIGGER_GPIO
pinMode(TRIGGER_GPIO, INPUT_PULLUP);
# endif
delay(10);
WiFi.mode(WIFI_STA);
if (!wifiProtocol) forceWifiProtocol();
+2 -2
View File
@@ -136,9 +136,9 @@ char gateway_name[parameters_size * 2] = Gateway_Name;
// LED Resistor 270-510R
#ifndef TRIGGER_GPIO
# 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
# 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