Skip to content

fixes for wake_up_on_touchscreen #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
// Time ESP32 will go to sleep (in seconds)
#define TIME_TO_SLEEP 30

// bitmask for GPIO_34 which is connected to MCP INTB
#define TOUCHPAD_WAKE_MASK (int64_t(1) << GPIO_NUM_34)

// Initiate Inkplate object
Inkplate display(INKPLATE_1BIT);

Expand All @@ -46,18 +43,6 @@ void setup()
display.setIntPin(PAD3, RISING);


// Init touchscreen and power it on after init (send false as argument to put it in deep sleep right after init)
if (display.tsInit(true))
{
Serial.println("Touchscreen init ok");
}
else
{
Serial.println("Touchscreen init fail");
while (true)
;
}

// Init touchscreen and power it on after init (send false as argument to put it in deep sleep right after init)
if (display.tsInit(true))
{
Expand All @@ -78,12 +63,9 @@ void setup()
// Go to sleep for TIME_TO_SLEEP seconds
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);

// Enable wakeup from deep sleep on gpio 36 (wake button)
// Enable wakeup from deep sleep on gpio 36 (wake button or touchscreen)
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);

// enable wake from MCP port expander on gpio 34
esp_sleep_enable_ext1_wakeup(TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ANY_HIGH);

// Go to sleep
esp_deep_sleep_start();
}
Expand Down