/** * dual_gif_demo.h — 两个 GIF 循环交替播放 * * 用 LVGL lv_gif 控件 + 单一控件切换 src 实现循环播放: * GIF1(播完) → GIF2(播完) → GIF1 → ... * * 优化点: * - 共用一个 lv_gif 控件,不重建(背景区域不刷新) * - GIF 数据直接从 SPIFFS 加载到 PSRAM * - 用 lv_timer 按 GIF 实际时长周期切换 */ #pragma once #include "esp_err.h" #include #include #ifdef __cplusplus extern "C" { #endif /** * 启动双 GIF 循环播放 * * @param path1 第一个 GIF 文件路径,例如 "/spiflash/dance_0_gesture.gif" * @param dur1_ms 第一个 GIF 完整播放一遍的时长(毫秒) * @param path2 第二个 GIF 文件路径 * @param dur2_ms 第二个 GIF 完整播放一遍的时长(毫秒) * @return ESP_OK 成功 */ esp_err_t dual_gif_demo_start(const char *path1, uint32_t dur1_ms, const char *path2, uint32_t dur2_ms); void dual_gif_demo_stop(void); bool dual_gif_demo_is_playing(void); #ifdef __cplusplus } #endif