Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
64
build_as_lib.py
Normal file
64
build_as_lib.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
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/*>")
|
||||||
|
elif item == "NRF52_PLATFORM":
|
||||||
|
src_filter.append("+<helpers/nrf52/*>")
|
||||||
|
elif item == "RP2040_PLATFORM":
|
||||||
|
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
|
||||||
|
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())
|
||||||
16
library.json
Normal file
16
library.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"name": "MeshCore",
|
||||||
|
"version" : "1.7.4",
|
||||||
|
"dependencies": {
|
||||||
|
"SPI": "*",
|
||||||
|
"Wire": "*",
|
||||||
|
"jgromes/RadioLib": "^7.1.2",
|
||||||
|
"rweather/Crypto": "^0.4.0",
|
||||||
|
"adafruit/RTClib": "^2.1.3",
|
||||||
|
"melopero/Melopero RV3028": "^1.1.0",
|
||||||
|
"electroniccats/CayenneLPP": "1.4.0"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"extraScript": "build_as_lib.py"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ build_flags =
|
|||||||
-D PIN_VEXT_EN=36
|
-D PIN_VEXT_EN=36
|
||||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=160
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
-D PIN_GPS_RX=47
|
-D PIN_GPS_RX=47
|
||||||
-D PIN_GPS_TX=48
|
-D PIN_GPS_TX=48
|
||||||
|
|||||||
@@ -45,6 +45,25 @@ lib_deps =
|
|||||||
${Station_G2.lib_deps}
|
${Station_G2.lib_deps}
|
||||||
${esp32_ota.lib_deps}
|
${esp32_ota.lib_deps}
|
||||||
|
|
||||||
|
[env:Station_G2_logging_repeater]
|
||||||
|
extends = Station_G2
|
||||||
|
build_flags =
|
||||||
|
${Station_G2.build_flags}
|
||||||
|
-D ADVERT_NAME='"Station G2 Logging Repeater"'
|
||||||
|
-D ADVERT_LAT=0.0
|
||||||
|
-D ADVERT_LON=0.0
|
||||||
|
-D ADMIN_PASSWORD='"password"'
|
||||||
|
-D MAX_NEIGHBOURS=8
|
||||||
|
-D MESH_PACKET_LOGGING=1
|
||||||
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
|
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${Station_G2.build_src_filter}
|
||||||
|
+<../examples/simple_repeater>
|
||||||
|
lib_deps =
|
||||||
|
${Station_G2.lib_deps}
|
||||||
|
${esp32_ota.lib_deps}
|
||||||
|
|
||||||
[env:Station_G2_room_server]
|
[env:Station_G2_room_server]
|
||||||
extends = Station_G2
|
extends = Station_G2
|
||||||
build_src_filter = ${Station_G2.build_src_filter}
|
build_src_filter = ${Station_G2.build_src_filter}
|
||||||
|
|||||||
Reference in New Issue
Block a user