Update toggleSleepMode and drop watchFaceDisabled

pull/78/head
-k 2021-07-27 12:59:44 -07:00
parent 9ca3c1b274
commit 075f3f99e7
2 changed files with 5 additions and 9 deletions

View File

@ -65,7 +65,7 @@ void Watchy::init(String datetime){
if(RTC_WAKE_IGNORE_REQUESTED == true && currentTime.Hour == SLEEP_HOUR && currentTime.Minute == SLEEP_MINUTE){ if(RTC_WAKE_IGNORE_REQUESTED == true && currentTime.Hour == SLEEP_HOUR && currentTime.Minute == SLEEP_MINUTE){
RTC_WAKE_IGNORE_ACTIVE = true; RTC_WAKE_IGNORE_ACTIVE = true;
RTC.alarmInterrupt(ALARM_2, false); RTC.alarmInterrupt(ALARM_2, false);
} }
showWatchFace(true); //partial updates on tick showWatchFace(true); //partial updates on tick
} }
break; break;
@ -91,10 +91,6 @@ void Watchy::init(String datetime){
deepSleep(); deepSleep();
} }
bool Watchy::watchFaceDisabled(){
return RTC_WAKE_IGNORE_ACTIVE;
}
void Watchy::deepSleep(){ void Watchy::deepSleep(){
#ifndef ESP_RTC #ifndef ESP_RTC
esp_sleep_enable_ext0_wakeup(RTC_PIN, 0); //enable deep sleep wake on RTC interrupt esp_sleep_enable_ext0_wakeup(RTC_PIN, 0); //enable deep sleep wake on RTC interrupt
@ -989,11 +985,12 @@ void Watchy::toggleSleepMode(){
display.fillScreen(GxEPD_BLACK); display.fillScreen(GxEPD_BLACK);
display.setFont(&FreeMonoBold9pt7b); display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_WHITE); display.setTextColor(GxEPD_WHITE);
display.setCursor(35, 90); display.drawRect(25, 65, 151, 60, GxEPD_WHITE);
display.setCursor(45, 90);
display.println("Sleep Mode"); display.println("Sleep Mode");
display.setCursor(35, 110); display.setCursor(45, 110);
display.print("set to:"); display.print("set to:");
display.setCursor(115, 110); display.setCursor(125, 110);
if(RTC_WAKE_IGNORE_REQUESTED == true){ if(RTC_WAKE_IGNORE_REQUESTED == true){
display.print("ON"); display.print("ON");
} }

View File

@ -46,7 +46,6 @@ class Watchy {
void toggleSleepMode(); void toggleSleepMode();
void showWatchFace(bool partialRefresh); void showWatchFace(bool partialRefresh);
bool watchFaceDisabled();
virtual void drawWatchFace(); //override this method for different watch faces virtual void drawWatchFace(); //override this method for different watch faces
private: private: