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

#647 - Fix for admin mode being forced on boards without hardware pullup #648

Merged
merged 2 commits into from Jan 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/main.cpp
Expand Up @@ -303,17 +303,20 @@ void setup()
digitalWrite(RESET_OLED, 1);
#endif

#ifdef BUTTON_PIN
#ifndef NO_ESP32
// If BUTTON_PIN is held down during the startup process,
// force the device to go into a SoftAP mode.
bool forceSoftAP = 0;
#ifdef BUTTON_PIN
#ifndef NO_ESP32
pinMode(BUTTON_PIN, INPUT);
#ifdef BUTTON_NEED_PULLUP
gpio_pullup_en((gpio_num_t)BUTTON_PIN);
#endif

// BUTTON_PIN is pulled high by a 12k resistor.
if (!digitalRead(BUTTON_PIN)) {
forceSoftAP = 1;
DEBUG_MSG("-------------------- Setting forceSoftAP = 1\n");
DEBUG_MSG("Setting forceSoftAP = 1\n");
}

#endif
Expand Down Expand Up @@ -513,7 +516,6 @@ void setup()
}
#endif


#ifndef NO_ESP32
// Initialize Wifi
initWifi(forceSoftAP);
Expand Down