Skip to content

Commit

Permalink
try new demos
Browse files Browse the repository at this point in the history
  • Loading branch information
qitas committed May 18, 2024
1 parent b68b2d8 commit ea12514
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 42 deletions.
58 changes: 31 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 3'
branches:
- main
paths:
- 'src/**'
- 'hal/**'
- 'platformio.ini'

jobs:
Linux:
Expand All @@ -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: |
Expand All @@ -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:
Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
12 changes: 5 additions & 7 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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\""
Expand All @@ -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>
Expand Down
20 changes: 13 additions & 7 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit ea12514

Please sign in to comment.