bezier and power level based stepping of backlight was not possible, used esp lcdc to fade the backlight off and on
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "lcd/ui_internal.h"
|
||||
#include "lcd/ui_log.h"
|
||||
#include "sd/sd.h"
|
||||
#include "lcd/lcd.h"
|
||||
|
||||
#define UI_IMAGE_PATH_PREFIX "A:/sdcard/"
|
||||
#define UI_IMAGE_PATH_MAX_LENGTH 160
|
||||
@@ -349,6 +350,7 @@ static bool ui_image_browser_display_prefetched(void){
|
||||
|
||||
/* Warm up the next image so the following switch is instant too. */
|
||||
ui_prefetch_next(index, slot);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -395,11 +397,22 @@ static void ui_image_browser_load_via_path(void){
|
||||
static void ui_image_browser_display_current(void){
|
||||
if(image_widget == NULL || image_browser_names == NULL || image_browser_image_count == 0) return;
|
||||
|
||||
if(ui_image_browser_display_prefetched()) return;
|
||||
ESP_LOGI(TAG, "Backlight sweep: turning off backlight");
|
||||
ui_log_append("Backlight sweep: turning off backlight");
|
||||
lcd_backlight_set(0);
|
||||
|
||||
if(ui_image_browser_display_prefetched()) goto done;
|
||||
ESP_LOGW(TAG, "Prefetched image unavailable: falling back to on-demand decoding");
|
||||
ui_log_append("Prefetched image unavailable: falling back to on-demand decoding");
|
||||
|
||||
/* Prefetch unavailable or render failed: fall back to on-demand decoding. */
|
||||
visible_slot = -1;
|
||||
ui_image_browser_load_via_path();
|
||||
|
||||
done:
|
||||
ESP_LOGI(TAG, "Backlight sweep: turning on backlight");
|
||||
ui_log_append("Backlight sweep: turning on backlight");
|
||||
lcd_backlight_set(255);
|
||||
}
|
||||
|
||||
void ui_image_browser_build_view(lv_obj_t *screen){
|
||||
|
||||
Reference in New Issue
Block a user