Update Watchy_Button_Test.ino

pull/1/head
SQFMI 2019-11-21 20:18:04 -05:00 committed by GitHub
parent 771e457427
commit bc4bf032bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -78,7 +78,7 @@ void handleButton()
display.deepSleep(); display.deepSleep();
} }
void updateTime(bool fullRefresh) void updateTime()
{ {
RTC.begin(); RTC.begin();
if(RTC.oscStopped(false)){ //check if RTC has been stopped if(RTC.oscStopped(false)){ //check if RTC has been stopped
@ -106,11 +106,7 @@ void updateTime(bool fullRefresh)
display.print('0'); display.print('0');
} }
display.print(currentTime.Minute); display.print(currentTime.Minute);
if(fullRefresh){ display.update();
display.update();
}else{
display.updateWindow(0, 0 , GxEPD_WIDTH, GxEPD_HEIGHT, true);
}
display.deepSleep(); display.deepSleep();
} }
@ -143,8 +139,8 @@ void detect_wakeup_reason(){
switch(wakeup_reason) switch(wakeup_reason)
{ {
case ESP_SLEEP_WAKEUP_EXT0: updateTime(false); break; //RTC Alarm case ESP_SLEEP_WAKEUP_EXT0: updateTime(); break; //RTC Alarm
case ESP_SLEEP_WAKEUP_EXT1: handleButton(); break; //Button Press case ESP_SLEEP_WAKEUP_EXT1: handleButton(); break; //Button Press
default: updateTime(true); //Reset default: updateTime(); //Reset
} }
} }