Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per default don't use TRIGGER_GPIO #633

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions main/User_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions main/config_M5.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion main/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -791,6 +792,9 @@ void checkButton() { // code from tzapu/wifimanager examples
}
}
}
# else
void checkButton() {}
# endif

void eraseAndRestart() {
# if defined(ESP8266)
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions test/Test_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down