Description of the problem: There are 5 BMP images on the SD card. A new image is read and displayed in the loop every 8 seconds.
With the first image «img_blau _ ###########. Bmp», the sequence between 0.7 and <8.7 seconds is called up by LVGL. With the second picture «img_gruen _ $$$$$$$$$$$$. Bmp», a sequence between 8.7 and <16.7 seconds is called up. It should be noted that «img_blau _ ############. Bmp» is also read again. In the following images, all images that have already been read are read in repeatedly. See the atachet log file.
After a while, the loop task is blocked in such a way that a picture change can only take place after a few minutes.
Question: Can or must I close a previously opened picture, if so, how?
The code:
void loop() {
lv_timer_handler();
delay(50);
if (millis() > timeNow + MAX_WAIT_IMG_CHG) {
timeNow = millis();
counter++;
if (counter >= MAX_IMGS) {
counter = 0;
}
lv_fs_drv_t *drive = getDriver();
if (drive != NULL) {
sd_close_cb(drive, getFilePointer());
}
/*Display Image */
lv_obj_t *img = lv_img_create(lv_scr_act());
lv_img_set_src(img, images[counter]);
lv_obj_center(img);
/* Heap Size */
// LV_LOG_INFO("Free Heap: %i", ESP.getFreeHeap());
}
}
platformio-device-monitor-211218-160140.txt (116.4 KB)