Skip to content

Commit

Permalink
Update Watchy_Button_Test.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
sqfmi authored Nov 22, 2019
1 parent 771e457 commit bc4bf03
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/Watchy_Button_Test/Watchy_Button_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void handleButton()
display.deepSleep();
}

void updateTime(bool fullRefresh)
void updateTime()
{
RTC.begin();
if(RTC.oscStopped(false)){ //check if RTC has been stopped
Expand Down Expand Up @@ -106,11 +106,7 @@ void updateTime(bool fullRefresh)
display.print('0');
}
display.print(currentTime.Minute);
if(fullRefresh){
display.update();
}else{
display.updateWindow(0, 0 , GxEPD_WIDTH, GxEPD_HEIGHT, true);
}
display.update();
display.deepSleep();
}

Expand Down Expand Up @@ -143,8 +139,8 @@ void detect_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
default: updateTime(true); //Reset
default: updateTime(); //Reset
}
}

0 comments on commit bc4bf03

Please sign in to comment.