Skip to content

Commit 1b0999f

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 2e2e677 + 0959e64 commit 1b0999f

File tree

5 files changed

+101
-2
lines changed

5 files changed

+101
-2
lines changed

build_as_lib.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
from os.path import realpath
2+
3+
Import("env") # type: ignore
4+
menv=env # type: ignore
5+
6+
src_filter = [
7+
'+<*.cpp>',
8+
'+<helpers/*.cpp>',
9+
'+<helpers/sensors>',
10+
'+<helpers/radiolib/*.cpp>',
11+
'+<helpers/ui/MomentaryButton.cpp>',
12+
'+<helpers/ui/buzzer.cpp>',
13+
]
14+
15+
# add build and include dirs according to CPPDEFINES
16+
for item in menv.get("CPPDEFINES", []):
17+
18+
# PLATFORM HANDLING
19+
if item == "STM32_PLATFORM":
20+
src_filter.append("+<helpers/stm32/*>")
21+
elif item == "ESP32":
22+
src_filter.append("+<helpers/esp32/*>")
23+
elif item == "NRF52_PLATFORM":
24+
src_filter.append("+<helpers/nrf52/*>")
25+
elif item == "RP2040_PLATFORM":
26+
src_filter.append("+<helpers/rp2040/*>")
27+
28+
# DISPLAY HANDLING
29+
elif isinstance(item, tuple) and item[0] == "DISPLAY_CLASS":
30+
display_class = item[1]
31+
src_filter.append(f"+<helpers/ui/{display_class}.cpp>")
32+
if (display_class == "ST7789Display") :
33+
src_filter.append(f"+<helpers/ui/OLEDDisplay.cpp>")
34+
src_filter.append(f"+<helpers/ui/OLEDDisplayFonts.cpp>")
35+
36+
# VARIANTS HANDLING
37+
elif isinstance(item, tuple) and item[0] == "MC_VARIANT":
38+
variant_name = item[1]
39+
src_filter.append(f"+<../variants/{variant_name}>")
40+
41+
# INCLUDE EXAMPLE CODE IN BUILD (to provide your own support files without touching the tree)
42+
elif isinstance(item, tuple) and item[0] == "BUILD_EXAMPLE":
43+
example_name = item[1]
44+
src_filter.append(f"+<../examples/{example_name}/*.cpp>")
45+
46+
# EXCLUDE A SOURCE FILE FROM AN EXAMPLE (must be placed after example name or boom)
47+
elif isinstance(item, tuple) and item[0] == "EXCLUDE_FROM_EXAMPLE":
48+
exclude_name = item[1]
49+
if example_name is None:
50+
print("***** PLEASE DEFINE EXAMPLE FIRST *****")
51+
break
52+
src_filter.append(f"-<../examples/{example_name}/{exclude_name}>")
53+
54+
# DEAL WITH UI VARIANT FOR AN EXAMPLE
55+
elif isinstance(item, tuple) and item[0] == "MC_UI_FLAVOR":
56+
ui_flavor = item[1]
57+
if example_name is None:
58+
print("***** PLEASE DEFINE EXAMPLE FIRST *****")
59+
break
60+
src_filter.append(f"+<../examples/{example_name}/{ui_flavor}/*.cpp>")
61+
62+
menv.Replace(SRC_FILTER=src_filter)
63+
64+
#print (menv.Dump())

library.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "MeshCore",
3+
"version" : "1.7.4",
4+
"dependencies": {
5+
"SPI": "*",
6+
"Wire": "*",
7+
"jgromes/RadioLib": "^7.1.2",
8+
"rweather/Crypto": "^0.4.0",
9+
"adafruit/RTClib": "^2.1.3",
10+
"melopero/Melopero RV3028": "^1.1.0",
11+
"electroniccats/CayenneLPP": "1.4.0"
12+
},
13+
"build": {
14+
"extraScript": "build_as_lib.py"
15+
}
16+
}

src/helpers/ui/ST7789Display.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <Wire.h>
55
#include <SPI.h>
66
#include <Adafruit_GFX.h>
7-
#include <ST7789Spi.h>
7+
#include "ST7789Spi.h"
88

99
class ST7789Display : public DisplayDriver {
1010
ST7789Spi display;

variants/heltec_v3/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ build_flags =
1717
-D PIN_VEXT_EN=36
1818
-D SX126X_DIO2_AS_RF_SWITCH=true
1919
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
20-
-D SX126X_CURRENT_LIMIT=140
20+
-D SX126X_CURRENT_LIMIT=160
2121
-D SX126X_RX_BOOSTED_GAIN=1
2222
-D PIN_GPS_RX=47
2323
-D PIN_GPS_TX=48

variants/station_g2/platformio.ini

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ lib_deps =
4545
${Station_G2.lib_deps}
4646
${esp32_ota.lib_deps}
4747

48+
[env:Station_G2_logging_repeater]
49+
extends = Station_G2
50+
build_flags =
51+
${Station_G2.build_flags}
52+
-D ADVERT_NAME='"Station G2 Logging Repeater"'
53+
-D ADVERT_LAT=0.0
54+
-D ADVERT_LON=0.0
55+
-D ADMIN_PASSWORD='"password"'
56+
-D MAX_NEIGHBOURS=8
57+
-D MESH_PACKET_LOGGING=1
58+
-D SX126X_RX_BOOSTED_GAIN=1
59+
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
60+
; -D MESH_DEBUG=1
61+
build_src_filter = ${Station_G2.build_src_filter}
62+
+<../examples/simple_repeater>
63+
lib_deps =
64+
${Station_G2.lib_deps}
65+
${esp32_ota.lib_deps}
66+
4867
[env:Station_G2_room_server]
4968
extends = Station_G2
5069
build_src_filter = ${Station_G2.build_src_filter}

0 commit comments

Comments
 (0)