Fixed only sleeping for ~2 minutes because of 32bit architecture and byte truncation

This commit is contained in:
Blue Fox 2022-08-21 22:52:30 +02:00
parent 0f36538ec0
commit ec3a219448

View File

@ -6,7 +6,8 @@
#define UNCOLORED 1
Epd epd;
int DEEP_SLEEP_TIME_uS = 6 * 60 * 60 * 1000 * 1000; // time to deep sleep in microseconds (not milliseconds!)
uint64_t us_s_conversion_factor = 1000*1000; // conversion factor for s to µs
uint64_t DEEP_SLEEP_TIME = 6*60*60; // time to deep sleep in microseconds (not milliseconds!)
// WiFi
char wiFiSSID[] = "SSID"; // SSID of your network
@ -22,7 +23,7 @@ sFONT TITLE_FONT = Font20;
char TITLE_TEXT[] = "Losung heute";
sFONT TEXT_FONT = Font12; // for the daily text
int TEXT_WIDTH = 168; // width of the box around the text; should be a multiple of the width of the font (eg. Font8 => multiple of 8)
int TEXT_PADDING_TOP = 40;
int TEXT_PADDING_TOP = 30;
int TEXT_PADDING_BETWEEN_BLOCKS = 20; // pixels between the lines
int TEXT_PADDING_BETWEEN_LINES = 1; // pixels between the lines
sFONT SOURCE_FONT = Font8; // for the position in bible
@ -43,9 +44,9 @@ void setup() {
showDailyText(getLosungFromHTML(html), getLehrtextFromHTML(html), getLosungSourceFromHTML(html), getLehrtextSourceFromHTML(html));
// deep sleep for 6 hours
esp_sleep_enable_timer_wakeup(DEEP_SLEEP_TIME_uS);
Serial.printf("[ESP32] Going to deep sleep mode.\n");
// deep sleep for DEEP_SLEEP_TIME seconds
esp_sleep_enable_timer_wakeup(DEEP_SLEEP_TIME*us_s_conversion_factor);
Serial.printf("[ESP32] Entering deep sleep mode for %ds\n", DEEP_SLEEP_TIME);
esp_deep_sleep_start();
}