Skip to content

Commit c4c4d5b

Browse files
authored
Merge pull request #25 from markfodor/bugfix/deep_clean
Fix deep clean issue when wake button is pressed and no event for the…
2 parents 53aa5eb + 6483d47 commit c4c4d5b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [1.1.1] - 2025-03-02
4+
5+
### Fixed
6+
- Deep clean when wake button is pressed and no event for the day [#23](https://github.com/markfodor/InkCal/issues/23)
7+
38
## [1.1.0] - 2025-02-24
49

510
### Added

client/InkCal/InkCal.ino

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int currentUiStep = 0;
3131
String currentTimestamp;
3232
int sleepInMins = 3600; // if error -> sleep for 6 hours
3333
bool deepClean = false; // if a deep clean is needed on the e-ink screen
34+
bool wakeButtonPressed = false;
3435
typedef struct {
3536
String startTime; // (HH:MM)
3637
String endTime;
@@ -59,6 +60,8 @@ void doDeepClean() {
5960
delay(1000);
6061
cycles--;
6162
}
63+
64+
Serial.print("Deep clean is done");
6265
}
6366

6467
void handleWakeup() {
@@ -67,7 +70,8 @@ void handleWakeup() {
6770

6871
switch(wakeup_reason) {
6972
case ESP_SLEEP_WAKEUP_EXT0:
70-
Serial.println("Wakeup caused by external signal using RTC_IO");
73+
wakeButtonPressed = true;
74+
Serial.println("Wakeup caused by external signal using RTC_IO");
7175
break;
7276
case ESP_SLEEP_WAKEUP_TIMER :
7377
Serial.println("Wakeup caused by timer");
@@ -176,7 +180,8 @@ void printCalendar() {
176180
display.begin(); // Init library (you should call this function ONLY ONCE)
177181
display.clearDisplay(); // Clear any data that may have been in (software) frame buffer.
178182

179-
if (deepClean) {
183+
// skip deep clean when wake button pressed
184+
if (!wakeButtonPressed && deepClean) {
180185
doDeepClean();
181186
}
182187

0 commit comments

Comments
 (0)