mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #662 from fdlamotte/lib_build_display_support
lib_build: Support display and example build
This commit is contained in:
commit
0ed8921153
2 changed files with 21 additions and 2 deletions
|
|
@ -6,9 +6,10 @@ 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>',
|
||||||
|
'+<helpers/ui/buzzer.cpp>',
|
||||||
]
|
]
|
||||||
|
|
||||||
# add build and include dirs according to CPPDEFINES
|
# add build and include dirs according to CPPDEFINES
|
||||||
|
|
@ -38,11 +39,29 @@ 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]
|
||||||
|
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}>")
|
||||||
|
|
||||||
|
# INCLUDE EXAMPLE CODE IN BUILD (to provide your own support files without touching the tree)
|
||||||
|
elif isinstance(item, tuple) and item[0] == "BUILD_EXAMPLE":
|
||||||
|
example_name = item[1]
|
||||||
|
src_filter.append(f"+<../examples/{example_name}>")
|
||||||
|
|
||||||
|
# EXCLUDE A SOURCE FILE FROM AN EXAMPLE (must be placed after example name or boom)
|
||||||
|
elif isinstance(item, tuple) and item[0] == "EXCLUDE_FROM_EXAMPLE":
|
||||||
|
exclude_name = item[1]
|
||||||
|
src_filter.append(f"-<../examples/{example_name}/{exclude_name}>")
|
||||||
|
|
||||||
menv.Replace(SRC_FILTER=src_filter)
|
menv.Replace(SRC_FILTER=src_filter)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <Adafruit_GFX.h>
|
#include <Adafruit_GFX.h>
|
||||||
#include <ST7789Spi.h>
|
#include "ST7789Spi.h"
|
||||||
|
|
||||||
class ST7789Display : public DisplayDriver {
|
class ST7789Display : public DisplayDriver {
|
||||||
ST7789Spi display;
|
ST7789Spi display;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue