Skip to content

Commit 342127d

Browse files
fixing Inmage_Frame_From_SD
1 parent e0d84f6 commit 342127d

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

examples/Inkplate6COLOR/Projects/Inkplate6COLOR_Image_Frame_From_SD/Inkplate6COLOR_Image_Frame_From_SD.ino

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,14 @@ void loop()
105105
display.printf("Error opening folder! Make sure \nthat you have entered the proper \nname and add / to the end "
106106
"of the \npath");
107107
display.display();
108-
deepSleep();
108+
// Turn off the power supply for the SD card
109+
display.sdCardSleep();
110+
111+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
112+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
113+
114+
// Put ESP32 into deep sleep (low power mode)
115+
esp_deep_sleep_start();
109116
}
110117

111118
// If the index is equal to 0, it is the end of the file so repeat the code in loop again
@@ -116,7 +123,14 @@ void loop()
116123
esp_sleep_enable_timer_wakeup(SECS_BETWEEN_PICTURES * 1000000LL);
117124

118125
// Go into deep sleep
119-
deepSleep();
126+
// Turn off the power supply for the SD card
127+
display.sdCardSleep();
128+
129+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
130+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
131+
132+
// Put ESP32 into deep sleep (low power mode)
133+
esp_deep_sleep_start();
120134
}
121135
}
122136

@@ -171,20 +185,7 @@ int getFileCount()
171185
}
172186
}
173187

174-
/**
175-
* @brief Turn off all peripherals, go to deep sleep, and enable wakeup on the wake button.
176-
*/
177-
void deepSleep()
178-
{
179-
// Turn off the power supply for the SD card
180-
display.sdCardSleep();
181188

182-
// Enable wakeup from deep sleep on GPIO 36 (wake button)
183-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
184-
185-
// Put ESP32 into deep sleep (low power mode)
186-
esp_deep_sleep_start();
187-
}
188189

189190
/**
190191
* @brief If it's the first file, the file open at index 0 won't work so skip this for the index zero (first file

0 commit comments

Comments
 (0)