diff --git a/build_as_lib.py b/build_as_lib.py index da4337c0..4e8eea57 100644 --- a/build_as_lib.py +++ b/build_as_lib.py @@ -6,9 +6,10 @@ menv=env # type: ignore src_filter = [ '+<*.cpp>', '+', - '+' + '+', '+', '+', + '+', ] # 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"]) src_filter.append("+") + # DISPLAY HANDLING + elif isinstance(item, tuple) and item[0] == "DISPLAY_CLASS": + display_class = item[1] + src_filter.append(f"+") + if (display_class == "ST7789Display") : + src_filter.append(f"+") + src_filter.append(f"+") + # VARIANTS HANDLING elif isinstance(item, tuple) and item[0] == "MC_VARIANT": variant_name = item[1] menv.Append(BUILD_FLAGS=[f"-I 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) diff --git a/src/helpers/ui/ST7789Display.h b/src/helpers/ui/ST7789Display.h index 8056de81..0f06da4c 100644 --- a/src/helpers/ui/ST7789Display.h +++ b/src/helpers/ui/ST7789Display.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include "ST7789Spi.h" class ST7789Display : public DisplayDriver { ST7789Spi display;