Skip to content

Commit eef1f33

Browse files
authored
Reverting touchpads on Inkplate 6
1 parent 7cb9825 commit eef1f33

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/Inkplate6/Advanced_Inkplate_Features/Inkplate_Wake_Up_On_Touchpads/Inkplate_Wake_Up_On_Touchpads.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
// Time ESP32 will go to sleep (in seconds)
2525
#define TIME_TO_SLEEP 30
2626

27-
// bitmask for GPIO_34 which is connected to MCP INTB
28-
#define TOUCHPAD_WAKE_MASK (int64_t(1) << GPIO_NUM_34)
29-
3027
// Initiate Inkplate object
3128
Inkplate display(INKPLATE_1BIT);
3229

30+
byte touchPadPin = PAD1;
31+
3332
// Store int in rtc data, to remain persistent during deep sleep
3433
RTC_DATA_ATTR int bootCount = 0;
3534

@@ -40,19 +39,20 @@ void setup()
4039

4140
// Setup mcp interrupts
4241
display.pinModeInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, INPUT);
43-
display.setIntOutputInternal(MCP23017_INT_ADDR, display.mcpRegsInt, 1, false, false, HIGH);
44-
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, RISING);
42+
display.setIntOutput(1, false, false, HIGH);
43+
display.setIntPin(touchPadPin, RISING);
4544

4645
++bootCount;
4746

4847
// Our function declared below
4948
displayInfo();
5049

51-
// Go to sleep for TIME_TO_SLEEP seconds
50+
// Go to sleep for TIME_TO_SLEEP seconds, but also enable wake up from gpio 34
51+
// Gpio 34 is where the mcp interrupt is connected, check
52+
// https://github.com/e-radionicacom/Inkplate-6-hardware/blob/master/Schematics%2C%20Gerber%2C%20BOM/Inkplate6%20Schematics.pdf
53+
// for more detail
5254
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
53-
54-
// enable wake from MCP port expander on gpio 34
55-
esp_sleep_enable_ext1_wakeup(TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ANY_HIGH);
55+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 1);
5656

5757
// Go to sleep
5858
esp_deep_sleep_start();

0 commit comments

Comments
 (0)