Trying to get to a state to start porting.

pull/156/head
Michael-Paul Moore 2022-04-10 14:50:59 -07:00
parent 5fb7950e91
commit bf45683e67
2 changed files with 16 additions and 2 deletions

View File

@ -43,7 +43,7 @@ void CWatchyExpanded::Init()
//deepSleep();
}
void Watchy::displayBusyCallback(const void*)
void Watchy::DisplayBusyCallback(const void*)
{
gpio_wakeup_enable((gpio_num_t)DISPLAY_BUSY, GPIO_INTR_LOW_LEVEL);
esp_sleep_enable_gpio_wakeup();
@ -75,3 +75,16 @@ void UpdateScreen()
m_display.display(true); //partial refresh
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();
}

View File

@ -16,8 +16,9 @@ class CWatchyExpanded
void Init();
private:
void displayBusyCallback(const void*);
void DisplayBusyCallback(const void*);
void UpdateScreen();
void DeepSleep();
std::vector<CWatchFace*> m_faces;
std::int8_t m_face = 0;