From ea1251418b8e466b34eb459eae414613a07cb6ba Mon Sep 17 00:00:00 2001 From: qitas Date: Sat, 18 May 2024 18:07:47 +0800 Subject: [PATCH] try new demos --- .github/workflows/ci.yml | 58 +++++++++++++++++++++------------------- README.md | 2 +- platformio.ini | 12 ++++----- src/main.c | 20 +++++++++----- 4 files changed, 50 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc2e841..0325ee0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,12 @@ name: CI on: push: pull_request: - schedule: - - cron: '0 0 * * 3' + branches: + - main + paths: + - 'src/**' + - 'hal/**' + - 'platformio.ini' jobs: Linux: @@ -15,8 +19,8 @@ jobs: sudo apt-get update sudo apt-get install libsdl2-dev - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Install PlatformIO run: | @@ -31,26 +35,26 @@ jobs: run: platformio run -e emulator_64bits - #Linux_i386: - # runs-on: ubuntu-latest - # steps: - # - name: Install Linux dependencies - # run: | - # sudo dpkg --add-architecture i386 - # sudo apt-get update - # sudo apt-get install libsdl2-dev:i386 gcc-multilib g++-multilib - # - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v1 - # - # - name: Install PlatformIO - # run: | - # python -m pip install --upgrade pip - # pip install -U platformio - # platformio update - # - # - name: Build emulator (sdl2, 32bits) - # run: platformio run -e emulator_32bits + Linux_i386: + runs-on: ubuntu-latest + steps: + - name: Install Linux dependencies + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install libsdl2-dev:i386 gcc-multilib g++-multilib + + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install -U platformio + platformio update + + - name: Build emulator (sdl2, 32bits) + run: platformio run -e emulator_32bits macOS: @@ -60,8 +64,8 @@ jobs: run: | HOMEBREW_NO_AUTO_UPDATE=1 brew install sdl2 - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Install PlatformIO run: | @@ -89,7 +93,7 @@ jobs: pacman --noconfirm -S --needed mingw-w64-x86_64-SDL2 gcc --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 #- uses: actions/setup-python@v1 - name: Install PlatformIO diff --git a/README.md b/README.md index 2336f83..9999e99 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Run LittlevGL via PlatformIO -[![CI](https://github.com/lvgl/lv_platformio/workflows/CI/badge.svg?branch=master)](https://github.com/lvgl/lv_platformio/actions) +[![CI](https://github.com/OS-Q/pio_gui_lvgl/workflows/CI/badge.svg)](https://github.com/OS-Q/pio_gui_lvgl/actions) This demo should help you to organize your project with awesome PlatformIO IDE. diff --git a/platformio.ini b/platformio.ini index e515483..ce7fefa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,17 +18,16 @@ build_flags = -D LV_CONF_SKIP -D LV_CONF_INCLUDE_SIMPLE ; Enable LVGL demo, remove when working on your own project - -D LV_USE_DEMO_WIDGETS=1 + -D LV_USE_DEMO_BENCHMARK=1 ; Add more defines below to overide lvgl:/src/lv_conf_simple.h lib_deps = ; Use direct URL, because package registry is unstable - ;lvgl@~7.11.0 - lvgl=https://github.com/lvgl/lvgl/archive/refs/tags/v8.2.0.zip + lvgl=https://github.com/os-q/lvgl/archive/refs/tags/v8.3.11.zip lib_archive = false [env:emulator_64bits] -platform = native@^1.1.3 +platform = native@^1.2.1 extra_scripts = support/sdl2_build_extra.py build_flags = ${env.build_flags} @@ -41,7 +40,7 @@ build_flags = -D LV_LVGL_H_INCLUDE_SIMPLE -D LV_DRV_NO_CONF -D USE_SDL - -D SDL_HOR_RES=480 + -D SDL_HOR_RES=240 -D SDL_VER_RES=320 -D SDL_ZOOM=1 -D SDL_INCLUDE_PATH="\"SDL2/SDL.h\"" @@ -57,8 +56,7 @@ build_flags = lib_deps = ${env.lib_deps} ; Use direct URL, because package registry is unstable - ;lv_drivers@~7.9.0 - lv_drivers=https://github.com/lvgl/lv_drivers/archive/refs/tags/v8.2.0.zip + lv_drivers=https://github.com/os-q/lv_drivers/archive/refs/tags/v8.3.0.zip build_src_filter = +<*> +<../hal/sdl2> diff --git a/src/main.c b/src/main.c index 24f33f6..b4b5ce0 100644 --- a/src/main.c +++ b/src/main.c @@ -16,11 +16,17 @@ int main(void) { - lv_init(); - - hal_setup(); - - lv_demo_widgets(); - - hal_loop(); + lv_init(); + hal_setup(); + #if LV_USE_DEMO_BENCHMARK + lv_demo_benchmark_set_max_speed(true); + lv_demo_benchmark(); + #elif LV_USE_DEMO_WIDGETS + lv_demo_widgets(); + #elif LV_USE_DEMO_STRESS + lv_demo_stress(); + #elif LV_USE_DEMO_MUSIC + lv_demo_music(); + #endif + hal_loop(); }