Created
September 25, 2022 19:44
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################ | |
# 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