example: Update lv_demos to use package manager

This commit is contained in:
Wu Jian Gang
2023-01-06 19:21:11 +08:00
parent 16ecee550b
commit 3fae2f08fe
5 changed files with 55 additions and 54 deletions
+4 -3
View File
@@ -4,8 +4,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(lv_demos)
# The following line can be removed after LVGL update to v8.3.5.
add_compile_options(-Wno-format)
project(lv_demos)
+1 -1
View File
@@ -1,3 +1,3 @@
idf_component_register(
SRCS
"lv_demos.c")
"lv_demos.c")
+3
View File
@@ -0,0 +1,3 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp-box: "2.*"
+31 -35
View File
@@ -1,38 +1,23 @@
/**
* @file lv_demos.c
* @brief Evaluate demos provided by 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 "bsp_board.h"
#include "bsp_lcd.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "lv_demos.h"
#include "lv_port.h"
#include "lvgl.h"
#include "bsp/esp-bsp.h"
#include "demos/lv_demos.h"
void app_main(void)
{
ESP_ERROR_CHECK(bsp_board_init());
/* Initialize I2C (for touch and audio) */
bsp_i2c_init();
ESP_ERROR_CHECK(lv_port_init());
bsp_lcd_set_backlight(true);
/* Initialize display and LVGL */
bsp_display_start();
/* Set display brightness to 100% */
bsp_display_backlight_on();
/**
* @brief Demos provided by LVGL.
@@ -40,12 +25,23 @@ void app_main(void)
* @note Only enable one demo every time.
*
*/
#if LV_USE_DEMO_WIDGETS
lv_demo_widgets(); /* A widgets example. This is what you get out of the box */
// lv_demo_music(); /* A modern, smartphone-like music player demo. */
// lv_demo_stress(); /* A stress test for LVGL. */
// lv_demo_benchmark(); /* A demo to measure the performance of LVGL or to compare different settings. */
#endif
do {
lv_task_handler();
} while (vTaskDelay(1), true);
}
#if LV_USE_DEMO_KEYPAD_AND_ENCODER
lv_demo_keypad_encoder(); /* Demonstrate the usage of encoder and keyboard */
#endif
#if LV_USE_DEMO_BENCHMARK
lv_demo_benchmark(); /* A demo to measure the performance of LVGL or to compare different settings. */
#endif
#if LV_USE_DEMO_STRESS
lv_demo_stress(); /* A stress test for LVGL. */
#endif
#if LV_USE_DEMO_MUSIC
lv_demo_music(); /* A modern, smartphone-like music player demo. */
#endif
}
+16 -15
View File
@@ -1,18 +1,19 @@
CONFIG_IDF_TARGET="esp32s3"
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_DETECT is not set
CONFIG_ALL_DISABLE=y
CONFIG_MODEL_IN_SDCARD=y
# CONFIG_USE_WAKENET is not set
# CONFIG_USE_MULTINET is not set
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_SIZE_KILOBYTES=48
CONFIG_LV_FONT_MONTSERRAT_12=y
CONFIG_LV_FONT_MONTSERRAT_16=y
CONFIG_LV_USE_DEMO_WIDGETS=y
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
CONFIG_ESP32S3_DATA_CACHE_64KB=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_FONT_MONTSERRAT_12=y
CONFIG_LV_FONT_MONTSERRAT_16=y
CONFIG_LV_MEM_SIZE_KILOBYTES=48
# Temporary disable demos, can turn on when LVGL at Espressif Component Registry update to 8.3.5
# CONFIG_LV_USE_DEMO_WIDGETS=y