Skip to content

Instantly share code, notes, and snippets.

@hpsaturn
Created September 25, 2022 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hpsaturn/fab2ba2edfcd6473d48ae5af97c01e99 to your computer and use it in GitHub Desktop.
Save hpsaturn/fab2ba2edfcd6473d48ae5af97c01e99 to your computer and use it in GitHub Desktop.
Workaround for LVGL config header on PlatformIO builds (lv_conf.h into hidden directory)
################################
# LVGL config loader
# @hpsaturn 2022
################################
# Put this file on the root of your PlatformIO LVGL project
# and add the next line on your env board in the platformio.ini file.
#
# extra_scripts = pre:prebuild.py
#
# The lv_conf.h file should be placed in the root lib folder
################################
import os.path
import shutil
from platformio import util
from SCons.Script import DefaultEnvironment
try:
import configparser
except ImportError:
import ConfigParser as configparser
# get platformio environment variables
env = DefaultEnvironment()
flavor = env.get("PIOENV")
output_path = ".pio/libdeps/" + flavor
os.makedirs(output_path, 0o755, True)
shutil.copy("lib/lv_conf.h", output_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment