Skip to content

Commit

Permalink
update for v8
Browse files Browse the repository at this point in the history
  • Loading branch information
qitas committed Jul 4, 2024
1 parent 172aa55 commit 1753ad7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 43 deletions.
57 changes: 30 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 3'
branches:
- main
paths:
- 'src/**'
- 'hal/**'
- 'platformio.ini'

jobs:
Linux:
Expand All @@ -16,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 @@ -32,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 @@ -61,7 +64,7 @@ jobs:
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install sdl2
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Install PlatformIO
Expand Down Expand Up @@ -90,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
16 changes: 8 additions & 8 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@ 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@9.1
lvgl=https://github.com/os-q/lvgl/archive/refs/tags/v8.4.0.zip
lib_archive = false


[env:emulator_64bits]
platform = native@^1.1.3
extra_scripts =
pre:support/sdl2_paths.py ; Tries to find SDL2 include and lib paths on your system - specifically for MacOS w/ Homebrew
post:support/sdl2_build_extra.py
platform = native@^1.2.1
extra_scripts = support/sdl2_build_extra.py
build_flags =
${env.build_flags}
; -D LV_LOG_LEVEL=LV_LOG_LEVEL_INFO
Expand All @@ -41,8 +39,8 @@ build_flags =
; SDL drivers options
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_DRV_NO_CONF
-D LV_USE_SDL
-D SDL_HOR_RES=480
-D USE_SDL
-D SDL_HOR_RES=240
-D SDL_VER_RES=320
-D SDL_ZOOM=1
-D LV_SDL_INCLUDE_PATH="\"SDL2/SDL.h\""
Expand All @@ -53,6 +51,8 @@ build_flags =

lib_deps =
${env.lib_deps}
; Use direct URL, because package registry is unstable
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 1753ad7

Please sign in to comment.