mirror of https://github.com/sqfmi/Watchy.git
parent
15179cfa0c
commit
aabb888069
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Watchy",
|
"name": "Watchy",
|
||||||
"version": "1.2.5",
|
"version": "1.2.6",
|
||||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name=Watchy
|
name=Watchy
|
||||||
version=1.2.5
|
version=1.2.6
|
||||||
author=SQFMI
|
author=SQFMI
|
||||||
maintainer=SQFMI
|
maintainer=SQFMI
|
||||||
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
||||||
|
|
|
@ -37,20 +37,39 @@ void Watchy::init(String datetime){
|
||||||
|
|
||||||
switch (wakeup_reason)
|
switch (wakeup_reason)
|
||||||
{
|
{
|
||||||
|
#ifdef ESP_RTC
|
||||||
|
case ESP_SLEEP_WAKEUP_TIMER: //ESP Internal RTC
|
||||||
|
if(guiState == WATCHFACE_STATE){
|
||||||
|
RTC.read(currentTime);
|
||||||
|
currentTime.Minute++;
|
||||||
|
tmElements_t tm;
|
||||||
|
tm.Month = currentTime.Month;
|
||||||
|
tm.Day = currentTime.Day;
|
||||||
|
tm.Year = currentTime.Year;
|
||||||
|
tm.Hour = currentTime.Hour;
|
||||||
|
tm.Minute = currentTime.Minute;
|
||||||
|
tm.Second = 0;
|
||||||
|
time_t t = makeTime(tm);
|
||||||
|
RTC.set(t);
|
||||||
|
RTC.read(currentTime);
|
||||||
|
showWatchFace(true); //partial updates on tick
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case ESP_SLEEP_WAKEUP_EXT0: //RTC Alarm
|
case ESP_SLEEP_WAKEUP_EXT0: //RTC Alarm
|
||||||
RTC.alarm(ALARM_2); //resets the alarm flag in the RTC
|
RTC.alarm(ALARM_2); //resets the alarm flag in the RTC
|
||||||
if(guiState == WATCHFACE_STATE){
|
if(guiState == WATCHFACE_STATE){
|
||||||
RTC.read(currentTime);
|
RTC.read(currentTime);
|
||||||
showWatchFace(true); //partial updates on tick
|
showWatchFace(true); //partial updates on tick
|
||||||
}else{
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESP_SLEEP_WAKEUP_EXT1: //button Press
|
case ESP_SLEEP_WAKEUP_EXT1: //button Press
|
||||||
handleButtonPress();
|
handleButtonPress();
|
||||||
break;
|
break;
|
||||||
default: //reset
|
default: //reset
|
||||||
|
#ifndef ESP_RTC
|
||||||
_rtcConfig(datetime);
|
_rtcConfig(datetime);
|
||||||
|
#endif
|
||||||
_bmaConfig();
|
_bmaConfig();
|
||||||
showWatchFace(false); //full update on reset
|
showWatchFace(false); //full update on reset
|
||||||
break;
|
break;
|
||||||
|
@ -59,7 +78,12 @@ void Watchy::init(String datetime){
|
||||||
}
|
}
|
||||||
|
|
||||||
void Watchy::deepSleep(){
|
void Watchy::deepSleep(){
|
||||||
|
#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
|
||||||
|
#endif
|
||||||
|
#ifdef ESP_RTC
|
||||||
|
esp_sleep_enable_timer_wakeup(60000000);
|
||||||
|
#endif
|
||||||
esp_sleep_enable_ext1_wakeup(BTN_PIN_MASK, ESP_EXT1_WAKEUP_ANY_HIGH); //enable deep sleep wake on button press
|
esp_sleep_enable_ext1_wakeup(BTN_PIN_MASK, ESP_EXT1_WAKEUP_ANY_HIGH); //enable deep sleep wake on button press
|
||||||
esp_deep_sleep_start();
|
esp_deep_sleep_start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue