mirror of https://github.com/sqfmi/Watchy.git
Moved clear alarm function
parent
81ab3feb94
commit
768f681c7b
|
@ -27,7 +27,6 @@ void Watchy::init(String datetime){
|
|||
switch (wakeup_reason)
|
||||
{
|
||||
case ESP_SLEEP_WAKEUP_EXT0: //RTC Alarm
|
||||
RTC.clearAlarm(); //resets the alarm flag in the RTC
|
||||
if(guiState == WATCHFACE_STATE){
|
||||
RTC.read(currentTime);
|
||||
showWatchFace(true); //partial updates on tick
|
||||
|
@ -53,14 +52,14 @@ void Watchy::displayBusyCallback(const void*){
|
|||
}
|
||||
|
||||
void Watchy::deepSleep(){
|
||||
// Set all pins to input to avoid power leaking out
|
||||
for(int i=0; i<48; i++) {
|
||||
pinMode(i, INPUT);
|
||||
}
|
||||
|
||||
esp_sleep_enable_ext0_wakeup(RTC_PIN, 0); //enable deep sleep wake on RTC interrupt
|
||||
esp_sleep_enable_ext1_wakeup(BTN_PIN_MASK, ESP_EXT1_WAKEUP_ANY_HIGH); //enable deep sleep wake on button press
|
||||
esp_deep_sleep_start();
|
||||
RTC.clearAlarm(); //resets the alarm flag in the RTC
|
||||
// Set pins 0-39 to input to avoid power leaking out
|
||||
for(int i=0; i<40; i++) {
|
||||
pinMode(i, INPUT);
|
||||
}
|
||||
esp_sleep_enable_ext0_wakeup(RTC_PIN, 0); //enable deep sleep wake on RTC interrupt
|
||||
esp_sleep_enable_ext1_wakeup(BTN_PIN_MASK, ESP_EXT1_WAKEUP_ANY_HIGH); //enable deep sleep wake on button press
|
||||
esp_deep_sleep_start();
|
||||
}
|
||||
|
||||
void Watchy::handleButtonPress(){
|
||||
|
@ -100,7 +99,6 @@ void Watchy::handleButtonPress(){
|
|||
//Back Button
|
||||
else if (wakeupBit & BACK_BTN_MASK){
|
||||
if(guiState == MAIN_MENU_STATE){//exit to watch face if already in menu
|
||||
RTC.clearAlarm(); //resets the alarm flag in the RTC
|
||||
RTC.read(currentTime);
|
||||
showWatchFace(false);
|
||||
}else if(guiState == APP_STATE){
|
||||
|
@ -179,7 +177,6 @@ void Watchy::handleButtonPress(){
|
|||
}else if(digitalRead(BACK_BTN_PIN) == 1){
|
||||
lastTimeout = millis();
|
||||
if(guiState == MAIN_MENU_STATE){//exit to watch face if already in menu
|
||||
RTC.clearAlarm(); //resets the alarm flag in the RTC
|
||||
RTC.read(currentTime);
|
||||
showWatchFace(false);
|
||||
break; //leave loop
|
||||
|
@ -896,4 +893,4 @@ void Watchy::updateFWBegin(){
|
|||
|
||||
// time_t t = makeTime(tm);
|
||||
// return t + FUDGE; //add fudge factor to allow for compile time
|
||||
// }
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue