Hi, so i have used the sleep management documentation to make sure my screen of my mcu goes to sleep until i touch the screen. I just don’t seem to understand it to well.
void timer_stop() {
}
void sleep() {
}
void mcu_sleep_task(void *args) {
while(1) {
if(lv_disp_get_inactive_time(NULL) < INACTIVITY_TIMEOUT_MS) {
ESP_LOGW(TAG, "inactive time: %d", (int)lv_disp_get_inactive_time(NULL));
lv_timer_handler();
} else {
timer_stop();
sleep();
}
vTaskDelay(pdMS_TO_TICKS(500));
}
}
So i run this in my main (task) and i log the count. the count goes to 5 seconds (inactivity_timeout_ms is set to 5 seconds). The documentation then just gives u 2 functions for the timer and sleep. On top of that they give u 3 extra lines without context or implementation examples.