mirror of https://github.com/sqfmi/Watchy.git
Trying to get to a state to start porting.
parent
5fb7950e91
commit
bf45683e67
|
@ -43,7 +43,7 @@ void CWatchyExpanded::Init()
|
||||||
//deepSleep();
|
//deepSleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Watchy::displayBusyCallback(const void*)
|
void Watchy::DisplayBusyCallback(const void*)
|
||||||
{
|
{
|
||||||
gpio_wakeup_enable((gpio_num_t)DISPLAY_BUSY, GPIO_INTR_LOW_LEVEL);
|
gpio_wakeup_enable((gpio_num_t)DISPLAY_BUSY, GPIO_INTR_LOW_LEVEL);
|
||||||
esp_sleep_enable_gpio_wakeup();
|
esp_sleep_enable_gpio_wakeup();
|
||||||
|
@ -75,3 +75,16 @@ void UpdateScreen()
|
||||||
m_display.display(true); //partial refresh
|
m_display.display(true); //partial refresh
|
||||||
guiState = kWatchFace_State;
|
guiState = kWatchFace_State;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWatchyExpanded::DeepSleep()
|
||||||
|
{
|
||||||
|
display.hibernate();
|
||||||
|
RTC.clearAlarm(); //resets the alarm flag in the RTC
|
||||||
|
|
||||||
|
for(int i=0; i<40; i++) // Set pins 0-39 to input to avoid power leaking out
|
||||||
|
pinMode(i, INPUT);
|
||||||
|
|
||||||
|
esp_sleep_enable_ext0_wakeup((gpio_num_t)RTC_INT_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();
|
||||||
|
}
|
||||||
|
|
|
@ -16,8 +16,9 @@ class CWatchyExpanded
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void displayBusyCallback(const void*);
|
void DisplayBusyCallback(const void*);
|
||||||
void UpdateScreen();
|
void UpdateScreen();
|
||||||
|
void DeepSleep();
|
||||||
|
|
||||||
std::vector<CWatchFace*> m_faces;
|
std::vector<CWatchFace*> m_faces;
|
||||||
std::int8_t m_face = 0;
|
std::int8_t m_face = 0;
|
||||||
|
|
Loading…
Reference in New Issue