lib_build: support display
This commit is contained in:
@@ -6,11 +6,13 @@ menv=env # type: ignore
|
|||||||
src_filter = [
|
src_filter = [
|
||||||
'+<*.cpp>',
|
'+<*.cpp>',
|
||||||
'+<helpers/*.cpp>',
|
'+<helpers/*.cpp>',
|
||||||
'+<helpers/sensors>'
|
'+<helpers/sensors>',
|
||||||
'+<helpers/radiolib/*.cpp>',
|
'+<helpers/radiolib/*.cpp>',
|
||||||
'+<helpers/ui/MomentaryButton.cpp>',
|
'+<helpers/ui/MomentaryButton.cpp>',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
use_display = False
|
||||||
|
|
||||||
# add build and include dirs according to CPPDEFINES
|
# add build and include dirs according to CPPDEFINES
|
||||||
for item in menv.get("CPPDEFINES", []):
|
for item in menv.get("CPPDEFINES", []):
|
||||||
|
|
||||||
@@ -38,12 +40,25 @@ for item in menv.get("CPPDEFINES", []):
|
|||||||
menv.Append(BUILD_FLAGS=["-I src/helpers/rp2040"])
|
menv.Append(BUILD_FLAGS=["-I src/helpers/rp2040"])
|
||||||
src_filter.append("+<helpers/rp2040/*>")
|
src_filter.append("+<helpers/rp2040/*>")
|
||||||
|
|
||||||
|
# DISPLAY HANDLING
|
||||||
|
elif isinstance(item, tuple) and item[0] == "DISPLAY_CLASS":
|
||||||
|
display_class = item[1]
|
||||||
|
use_display = True
|
||||||
|
src_filter.append(f"+<helpers/ui/{display_class}.cpp>")
|
||||||
|
if (display_class == "ST7789Display") :
|
||||||
|
src_filter.append(f"+<helpers/ui/OLEDDisplay.cpp>")
|
||||||
|
src_filter.append(f"+<helpers/ui/OLEDDisplayFonts.cpp>")
|
||||||
|
|
||||||
# VARIANTS HANDLING
|
# VARIANTS HANDLING
|
||||||
elif isinstance(item, tuple) and item[0] == "MC_VARIANT":
|
elif isinstance(item, tuple) and item[0] == "MC_VARIANT":
|
||||||
variant_name = item[1]
|
variant_name = item[1]
|
||||||
menv.Append(BUILD_FLAGS=[f"-I variants/{variant_name}"])
|
menv.Append(BUILD_FLAGS=[f"-I variants/{variant_name}"])
|
||||||
src_filter.append(f"+<../variants/{variant_name}>")
|
src_filter.append(f"+<../variants/{variant_name}>")
|
||||||
|
|
||||||
|
if use_display :
|
||||||
|
menv.Append(CPPPATH=[realpath("src/helpers/ui")])
|
||||||
|
menv.Append(BUILD_FLAGS=["-I src/helpers/ui"])
|
||||||
|
|
||||||
menv.Replace(SRC_FILTER=src_filter)
|
menv.Replace(SRC_FILTER=src_filter)
|
||||||
|
|
||||||
#print (menv.Dump())
|
#print (menv.Dump())
|
||||||
|
|||||||
Reference in New Issue
Block a user