Skip to content

Commit 2d330b7

Browse files
committed
Button 3
1 parent f048cfb commit 2d330b7

5 files changed

Lines changed: 10 additions & 2 deletions

File tree

2 Bytes
Binary file not shown.
28 Bytes
Binary file not shown.

ESP32_AP-Flasher/include/system.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define WAKEUP_REASON_NFC 3
77
#define WAKEUP_REASON_BUTTON1 4
88
#define WAKEUP_REASON_BUTTON2 5
9+
#define WAKEUP_REASON_BUTTON3 6
910
#define WAKEUP_REASON_FAILED_OTA_FW 0xE0
1011
#define WAKEUP_REASON_FIRSTBOOT 0xFC
1112
#define WAKEUP_REASON_NETWORK_SCAN 0xFD

ESP32_AP-Flasher/src/contentmanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
bool needRedraw(uint8_t contentMode, uint8_t wakeupReason) {
4848
// contentmode 26, timestamp
49-
if ((wakeupReason == WAKEUP_REASON_BUTTON1 || wakeupReason == WAKEUP_REASON_BUTTON2) && contentMode == 26) return true;
49+
if ((wakeupReason == WAKEUP_REASON_BUTTON1 || wakeupReason == WAKEUP_REASON_BUTTON2 || wakeupReason == WAKEUP_REASON_BUTTON3) && contentMode == 26) return true;
5050
return false;
5151
}
5252

@@ -2264,7 +2264,7 @@ int getJsonTemplateUrl(String &filename, String URL, time_t fetched, String MAC,
22642264
http.addHeader("If-Modified-Since", formatHttpDate(fetched));
22652265
http.addHeader("X-ESL-MAC", MAC);
22662266
http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
2267-
http.setTimeout(5000);
2267+
http.setTimeout(20000);
22682268
const int httpCode = http.GET();
22692269
if (httpCode == 200) {
22702270
drawJsonStream(http.getStream(), filename, taginfo, imageParams);

ESP32_AP-Flasher/wwwroot/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const WAKEUP_REASON_GPIO = 2;
66
const WAKEUP_REASON_NFC = 3;
77
const WAKEUP_REASON_BUTTON1 = 4;
88
const WAKEUP_REASON_BUTTON2 = 5;
9+
const WAKEUP_REASON_BUTTON3 = 6;
910
const WAKEUP_REASON_FAILED_OTA_FW = 0xE0;
1011
const WAKEUP_REASON_FIRSTBOOT = 0xFC;
1112
const WAKEUP_REASON_NETWORK_SCAN = 0xFD;
@@ -394,7 +395,9 @@ function processTags(tagArray) {
394395
$('#tag' + tagmac + ' .warningicon').style.display = 'none';
395396
$('#tag' + tagmac).style.background = "#ffffff";
396397
if (element.contentMode == 12 || element.nextcheckin == 3216153600) $('#tag' + tagmac).style.background = "#e4e4e0";
398+
397399
switch (parseInt(element.wakeupReason)) {
400+
398401
case WAKEUP_REASON_TIMED:
399402
break;
400403
case WAKEUP_REASON_BOOT:
@@ -414,6 +417,10 @@ function processTags(tagArray) {
414417
$('#tag' + tagmac + ' .nextcheckin').innerHTML = "Button 2 pressed"
415418
$('#tag' + tagmac).style.background = "#c8f1bb";
416419
break;
420+
case WAKEUP_REASON_BUTTON3:
421+
$('#tag' + tagmac + ' .nextcheckin').innerHTML = "Button 3 pressed"
422+
$('#tag' + tagmac).style.background = "#c8f1bb";
423+
break;
417424
case WAKEUP_REASON_NFC:
418425
$('#tag' + tagmac + ' .nextcheckin').innerHTML = "NFC wakeup"
419426
$('#tag' + tagmac).style.background = "#c8f1bb";

0 commit comments

Comments
 (0)