PlatformIO project example for LVGL
This demo should help you to organize your project with awesome PlatformIO IDE.
https://code.visualstudio.com/ - follow instructions there, if you don't have vscode yet.
Linux (Ubuntu, Debian, ...)
Use one of options below:
# 64 bits
sudo apt-get install libsdl2-dev# 32 bits
sudo apt-get install gcc-multilib g++-multilib libsdl2-dev:i386Note:
libsdl2-dev:i386 install, remove 64-bits version
and dependencies first.MacOS
Use Homebrew:
brew install sdl2Note: On MacOS you need to include (uncomment in provided example platformio.ini file) these lines in your platformio.ini file to import the drivers:
; SDL2 includes
!find /opt/homebrew/Cellar/sdl2 -name "include" | sed "s/^/-I /"
!find /opt/homebrew/Cellar/sdl2 -name "libSDL2.a" | xargs dirname | sed "s/^/-L /"If you get the following error on M-chip Mac with VSCode, you can add -arch arm64 to build_flags in platformio.ini or just run pio run -e emulator_64bits -t execute in the system Python environment. (pio should be installed in system Python first).
ld: warning: ignoring file '/opt/homebrew/Cellar/sdl2/2.30.1/lib/libSDL2-2.0.0.dylib': found architecture 'arm64', required architecture 'x86_64'
ld: Undefined symbols:
_SDL_CreateRenderer, referenced from:
_window_create in sdl.o
...Windows
Use MSYS2
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2Add the path to your Mingw-w64 bin folder to the Windows PATH environment
variable (usually C:\msys64\mingw64\bin). See instruction, 4.
ESP32
This project uses the Arduino framework and the LovyanGFX library for display drivers.
hal/esp32/app_hal.cpp file. .hpp file for your display. platformio.ini file matches the board settings. .hpp file.hal/esp32/displays/. lgfx_{board_name}.hpp, replacing {board_name} with your board's name..hpp file to the hal/esp32/app_hal.cpp file and ensure it's included correctly..hpp file, include the recommended board configuration for reference.Make sure to test your setup to confirm compatibility.
If you plan to upload firmware & debug hardware, read notes in PlatformIO install docs.
File -> Open Folder... menu.To build/execute, on PlafomIO tab expand desired env and click target:
Note, for emulator env upload also executes compiled binary.
No open issues yet, or sync has not completed.