example: Update image_display to use package manager
This commit is contained in:
@@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS ../../components)
|
||||
|
||||
add_compile_options(-fdiagnostics-color=always)
|
||||
|
||||
project(image_display)
|
||||
# The following line can be removed after LVGL update to v8.3.5.
|
||||
add_compile_options(-Wno-format)
|
||||
|
||||
project(image_display)
|
||||
@@ -0,0 +1,3 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp-box: "2.*"
|
||||
@@ -1,36 +1,13 @@
|
||||
/**
|
||||
* @file image_display.c
|
||||
* @brief Display png image with LVGL
|
||||
* @version 0.1
|
||||
* @date 2021-10-19
|
||||
*
|
||||
* @copyright Copyright 2021 Espressif Systems (Shanghai) Co. Ltd.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
#include "bsp/esp-bsp.h"
|
||||
#include "esp_log.h"
|
||||
#include "bsp_board.h"
|
||||
#include "bsp_lcd.h"
|
||||
#include "bsp_btn.h"
|
||||
#include "bsp_lcd.h"
|
||||
#include "bsp_storage.h"
|
||||
#include "lv_port.h"
|
||||
#include "lv_port_fs.h"
|
||||
#include "lvgl.h"
|
||||
|
||||
static const char *TAG = "main";
|
||||
|
||||
@@ -40,17 +17,19 @@ static void image_display(void);
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
ESP_ERROR_CHECK(bsp_board_init());
|
||||
ESP_ERROR_CHECK(bsp_spiffs_init_default());
|
||||
/* Initialize I2C (for touch and audio) */
|
||||
bsp_i2c_init();
|
||||
|
||||
/* Initialize display and LVGL */
|
||||
bsp_display_start();
|
||||
|
||||
/* Set display brightness to 100% */
|
||||
bsp_display_backlight_on();
|
||||
|
||||
/* Mount SPIFFS */
|
||||
bsp_spiffs_mount();
|
||||
|
||||
ESP_ERROR_CHECK(lv_port_init());
|
||||
ESP_ERROR_CHECK(lv_port_fs_init());
|
||||
bsp_lcd_set_backlight(true);
|
||||
image_display();
|
||||
|
||||
do {
|
||||
lv_task_handler();
|
||||
} while (vTaskDelay(1), true);
|
||||
}
|
||||
|
||||
static void btn_event_cb(lv_event_t *event)
|
||||
@@ -111,5 +90,4 @@ static void image_display(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,28 @@
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_DETECT is not set
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_ALL_DISABLE=y
|
||||
CONFIG_MODEL_IN_SDCARD=y
|
||||
# CONFIG_USE_WAKENET is not set
|
||||
# CONFIG_USE_MULTINET is not set
|
||||
CONFIG_LV_USE_PNG=y
|
||||
CONFIG_LV_USE_BMP=y
|
||||
CONFIG_LV_USE_SJPG=y
|
||||
CONFIG_LV_USE_GIF=y
|
||||
CONFIG_LV_MEM_CUSTOM=y
|
||||
CONFIG_LV_COLOR_16_SWAP=y
|
||||
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
|
||||
|
||||
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
|
||||
|
||||
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
|
||||
|
||||
CONFIG_ESP32S3_DATA_CACHE_64KB=y
|
||||
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
|
||||
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
|
||||
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
||||
|
||||
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
|
||||
CONFIG_LV_COLOR_16_SWAP=y
|
||||
# 83 == 'S'
|
||||
CONFIG_LV_FS_POSIX_LETTER=83
|
||||
CONFIG_LV_MEM_CUSTOM=y
|
||||
CONFIG_LV_USE_BMP=y
|
||||
CONFIG_LV_USE_FS_POSIX=y
|
||||
CONFIG_LV_USE_GIF=y
|
||||
CONFIG_LV_USE_PNG=y
|
||||
CONFIG_LV_USE_SJPG=y
|
||||
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
|
||||
CONFIG_SPIRAM_MODE_OCT=y
|
||||
CONFIG_SPIRAM_SPEED_80M=y
|
||||
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
|
||||
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
|
||||
CONFIG_FATFS_LFN_STACK=y
|
||||
CONFIG_SPIRAM_SPEED_80M=y
|
||||
Reference in New Issue
Block a user