mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-09-18 07:56:29 +00:00
- scope the serial config CLI to RP2040; it was exposing the rescue CLI (cat/rm/erase) on every ESP32 WiFi build, which gates it behind a physical long-press - bound and space out RP2040 rejoins: the core's join busy-waits, so cap it at 5s and retry every 30s instead of every 10s - stamp the reconnect timer in setup(), so the first loop() doesn't tear down an association that is still finishing DHCP - treat stored credentials as a pair, and pass NULL (not "") for an open network - teach build_as_lib.py where SerialWifiInterface moved
67 lines
2.3 KiB
Python
67 lines
2.3 KiB
Python
from os.path import realpath
|
|
|
|
Import("env") # type: ignore
|
|
menv=env # type: ignore
|
|
|
|
src_filter = [
|
|
'+<*.cpp>',
|
|
'+<helpers/*.cpp>',
|
|
'+<helpers/sensors>',
|
|
'+<helpers/radiolib/*.cpp>',
|
|
'+<helpers/ui/MomentaryButton.cpp>',
|
|
'+<helpers/ui/buzzer.cpp>',
|
|
]
|
|
|
|
# add build and include dirs according to CPPDEFINES
|
|
for item in menv.get("CPPDEFINES", []):
|
|
|
|
# PLATFORM HANDLING
|
|
if item == "STM32_PLATFORM":
|
|
src_filter.append("+<helpers/stm32/*>")
|
|
elif item == "ESP32":
|
|
src_filter.append("+<helpers/esp32/*>")
|
|
src_filter.append("+<helpers/wifi/*>")
|
|
elif item == "NRF52_PLATFORM":
|
|
src_filter.append("+<helpers/nrf52/*>")
|
|
elif item == "RP2040_PLATFORM":
|
|
src_filter.append("+<helpers/rp2040/*>")
|
|
src_filter.append("+<helpers/wifi/*>")
|
|
|
|
# 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
|
|
elif isinstance(item, tuple) and item[0] == "MC_VARIANT":
|
|
variant_name = item[1]
|
|
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}/*.cpp>")
|
|
|
|
# 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]
|
|
if example_name is None:
|
|
print("***** PLEASE DEFINE EXAMPLE FIRST *****")
|
|
break
|
|
src_filter.append(f"-<../examples/{example_name}/{exclude_name}>")
|
|
|
|
# DEAL WITH UI VARIANT FOR AN EXAMPLE
|
|
elif isinstance(item, tuple) and item[0] == "MC_UI_FLAVOR":
|
|
ui_flavor = item[1]
|
|
if example_name is None:
|
|
print("***** PLEASE DEFINE EXAMPLE FIRST *****")
|
|
break
|
|
src_filter.append(f"+<../examples/{example_name}/{ui_flavor}/*.cpp>")
|
|
|
|
menv.Replace(SRC_FILTER=src_filter)
|
|
|
|
#print (menv.Dump())
|