Skip to content

Commit

Permalink
v1.5, limit 4-press AP-reset to once per powercycle
Browse files Browse the repository at this point in the history
  • Loading branch information
VonSzarvas committed Oct 24, 2022
1 parent 325298a commit 1a5cf60
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 3 deletions.
Binary file not shown.
Binary file added libesphttpd/espfs/mkespfsimage/main.o
Binary file not shown.
Binary file added libesphttpd/espfs/mkespfsimage/mkespfsimage
Binary file not shown.
Binary file added libesphttpd/libesphttpd.a
Binary file not shown.
Binary file added libesphttpd/libwebpages-espfs.a
Binary file not shown.
Binary file added libesphttpd/webpages.espfs
Binary file not shown.
22 changes: 19 additions & 3 deletions parallax/cgiprop.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void ICACHE_FLASH_ATTR httpdSendResponse(HttpdConnData *connData, int code, char
static ETSTimer resetButtonTimer;
static int resetButtonState;
static int resetButtonCount;
static int resetFourPressFired;

static void wifiLoadCompletionCB(PropellerConnection *connection, LoadStatus status);
static void loadCompletionCB(PropellerConnection *connection, LoadStatus status);
Expand Down Expand Up @@ -813,9 +814,24 @@ static void ICACHE_FLASH_ATTR resetButtonTimerCallback(void *data)


else if (++buttonPressCount == RESET_BUTTON_PRESS_COUNT) {
os_printf("Entering STA+AP mode\n");
wifi_set_opmode(STATIONAP_MODE);
buttonPressCount = 0;

// - Update 2022.Oct.24.
// - Only allow Reset Button recovery once after each power-cycle
// - Note: Could disarm the timer after first call, but for customer remote debugging add a debuglog
// - message to represent if multiple attempts being made, and only disarm after the 2nd attempt.

if (resetFourPressFired == 0) {
os_printf("Entering STA+AP mode\n");
wifi_set_opmode(STATIONAP_MODE);
resetFourPressFired = 1;
buttonPressCount = 0;

} else {
os_printf("Ignore 4-press recovery request. Powercycle required.\n");
os_timer_disarm(&resetButtonTimer);
buttonPressCount = 0;
}

}


Expand Down

0 comments on commit 1a5cf60

Please sign in to comment.