Skip to content

Commit 4413e5b

Browse files
author
Scott Powell
committed
Merge branch 'dev'
2 parents d8c4fa4 + 8b3c16c commit 4413e5b

File tree

174 files changed

+5172
-606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+5172
-606
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ out/
99
.DS_Store
1010
.vscode/settings.json
1111
.vscode/extensions.json
12+
.idea
13+
cmake-*
14+
.cache
15+
.ccls
16+
compile_commands.json

boards/heltec_mesh_solar.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "nrf52840_s140_v6.ld"
5+
},
6+
"core": "nRF5",
7+
"cpu": "cortex-m4",
8+
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
9+
"f_cpu": "64000000L",
10+
"hwids": [
11+
["0x239A","0x8029"],
12+
["0x239A","0x0029"],
13+
["0x239A","0x002A"],
14+
["0x239A","0x802A"]
15+
],
16+
"usb_product": "HT-n5262",
17+
"mcu": "nrf52840",
18+
"variant": "heltec_mesh_solar",
19+
"bsp": {
20+
"name": "adafruit"
21+
},
22+
"softdevice": {
23+
"sd_flags": "-DS140",
24+
"sd_name": "s140",
25+
"sd_version": "6.1.1",
26+
"sd_fwid": "0x00B6"
27+
},
28+
"bootloader": {
29+
"settings_addr": "0xFF000"
30+
}
31+
},
32+
"connectivity": [
33+
"bluetooth"
34+
],
35+
"debug": {
36+
"jlink_device": "nRF52840_xxAA",
37+
"svd_path": "nrf52840.svd",
38+
"openocd_target": "nrf52.cfg"
39+
},
40+
"frameworks": [
41+
"arduino"
42+
],
43+
"name": "Heltec Mesh Solar Board",
44+
"upload": {
45+
"maximum_ram_size": 248832,
46+
"maximum_size": 815104,
47+
"speed": 115200,
48+
"protocol": "nrfutil",
49+
"protocols": [
50+
"jlink",
51+
"nrfjprog",
52+
"nrfutil",
53+
"stlink"
54+
],
55+
"use_1200bps_touch": true,
56+
"require_upload_port": true,
57+
"wait_for_upload_port": true
58+
},
59+
"url": "https://heltec.org/",
60+
"vendor": "Heltec"
61+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default_16MB.csv",
6+
"memory_type": "qio_opi"
7+
},
8+
"core": "esp32",
9+
"extra_flags": [
10+
"-DBOARD_HAS_PSRAM",
11+
"-DARDUINO_USB_MODE=0",
12+
"-DARDUINO_USB_CDC_ON_BOOT=1",
13+
"-DARDUINO_RUNNING_CORE=1",
14+
"-DARDUINO_EVENT_RUNNING_CORE=1"
15+
],
16+
"f_cpu": "240000000L",
17+
"f_flash": "80000000L",
18+
"flash_mode": "qio",
19+
"psram_type": "opi",
20+
"hwids": [
21+
["0x303A", "0x1001"],
22+
["0x303A", "0x0002"]
23+
],
24+
"mcu": "esp32s3",
25+
"variant": "heltec_vision_master_e213"
26+
},
27+
"connectivity": ["wifi", "bluetooth", "lora"],
28+
"debug": {
29+
"openocd_target": "esp32s3.cfg"
30+
},
31+
"frameworks": ["arduino", "espidf"],
32+
"name": "Heltec Vision Master E213",
33+
"upload": {
34+
"flash_size": "16MB",
35+
"maximum_ram_size": 8388608,
36+
"maximum_size": 16777216,
37+
"use_1200bps_touch": true,
38+
"wait_for_upload_port": true,
39+
"require_upload_port": true,
40+
"speed": 921600
41+
},
42+
"url": "https://heltec.org/project/vision-master-e213/",
43+
"vendor": "Heltec"
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default_16MB.csv",
6+
"memory_type": "qio_opi"
7+
},
8+
"core": "esp32",
9+
"extra_flags": [
10+
"-DBOARD_HAS_PSRAM",
11+
"-DARDUINO_USB_MODE=0",
12+
"-DARDUINO_USB_CDC_ON_BOOT=1",
13+
"-DARDUINO_RUNNING_CORE=1",
14+
"-DARDUINO_EVENT_RUNNING_CORE=1"
15+
],
16+
"f_cpu": "240000000L",
17+
"f_flash": "80000000L",
18+
"flash_mode": "qio",
19+
"psram_type": "opi",
20+
"hwids": [
21+
["0x303A", "0x1001"],
22+
["0x303A", "0x0002"]
23+
],
24+
"mcu": "esp32s3",
25+
"variant": "heltec_vision_master_e290"
26+
},
27+
"connectivity": ["wifi", "bluetooth", "lora"],
28+
"debug": {
29+
"openocd_target": "esp32s3.cfg"
30+
},
31+
"frameworks": ["arduino", "espidf"],
32+
"name": "Heltec Vision Master E290",
33+
"upload": {
34+
"flash_size": "16MB",
35+
"maximum_ram_size": 8388608,
36+
"maximum_size": 16777216,
37+
"use_1200bps_touch": true,
38+
"wait_for_upload_port": true,
39+
"require_upload_port": true,
40+
"speed": 921600
41+
},
42+
"url": "https://heltec.org/project/vision-master-e290/",
43+
"vendor": "Heltec"
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default_16MB.csv",
6+
"memory_type": "qio_opi"
7+
},
8+
"core": "esp32",
9+
"extra_flags": [
10+
"-DBOARD_HAS_PSRAM",
11+
"-DARDUINO_USB_MODE=0",
12+
"-DARDUINO_USB_CDC_ON_BOOT=1",
13+
"-DARDUINO_RUNNING_CORE=1",
14+
"-DARDUINO_EVENT_RUNNING_CORE=1"
15+
],
16+
"f_cpu": "240000000L",
17+
"f_flash": "80000000L",
18+
"flash_mode": "qio",
19+
"psram_type": "opi",
20+
"hwids": [
21+
["0x303A", "0x1001"],
22+
["0x303A", "0x0002"]
23+
],
24+
"mcu": "esp32s3",
25+
"variant": "heltec_vision_master_t190"
26+
},
27+
"connectivity": ["wifi", "bluetooth", "lora"],
28+
"debug": {
29+
"openocd_target": "esp32s3.cfg"
30+
},
31+
"frameworks": ["arduino", "espidf"],
32+
"name": "Heltec Vision Master T190",
33+
"upload": {
34+
"flash_size": "16MB",
35+
"maximum_ram_size": 8388608,
36+
"maximum_size": 16777216,
37+
"use_1200bps_touch": true,
38+
"wait_for_upload_port": true,
39+
"require_upload_port": true,
40+
"speed": 921600
41+
},
42+
"url": "https://heltec.org/project/vision-master-t190/",
43+
"vendor": "Heltec"
44+
}

boards/seeed-wio-tracker-l1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
],
4141
"name": "Seeed Wio Tracker L1",
4242
"upload": {
43-
"maximum_ram_size": 248832,
44-
"maximum_size": 815104,
43+
"maximum_ram_size": 237568,
44+
"maximum_size": 811008,
4545
"protocol": "nrfutil",
4646
"speed": 115200,
4747
"protocols": [

build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# usage
44
# sh build.sh build-firmware RAK_4631_Repeater
55
# sh build.sh build-firmwares
6+
# sh build.sh build-matching-firmwares RAK_4631
67
# sh build.sh build-companion-firmwares
78
# sh build.sh build-repeater-firmwares
89
# sh build.sh build-room-server-firmwares
@@ -144,6 +145,16 @@ mkdir -p out
144145
if [[ $1 == "build-firmware" ]]; then
145146
if [ "$2" ]; then
146147
build_firmware $2
148+
else
149+
echo "usage: $0 build-firmware <target>"
150+
exit 1
151+
fi
152+
elif [[ $1 == "build-matching-firmwares" ]]; then
153+
if [ "$2" ]; then
154+
build_all_firmwares_matching $2
155+
else
156+
echo "usage: $0 build-matching-firmwares <build-match-spec>"
157+
exit 1
147158
fi
148159
elif [[ $1 == "build-firmwares" ]]; then
149160
build_firmwares

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())
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#pragma once
2+
3+
#include <MeshCore.h>
4+
#include <helpers/ui/DisplayDriver.h>
5+
#include <helpers/ui/UIScreen.h>
6+
#include <helpers/SensorManager.h>
7+
#include <helpers/BaseSerialInterface.h>
8+
#include <Arduino.h>
9+
10+
#ifdef PIN_BUZZER
11+
#include <helpers/ui/buzzer.h>
12+
#endif
13+
14+
#include "NodePrefs.h"
15+
16+
enum class UIEventType {
17+
none,
18+
contactMessage,
19+
channelMessage,
20+
roomMessage,
21+
newContactMessage,
22+
ack
23+
};
24+
25+
class AbstractUITask {
26+
protected:
27+
mesh::MainBoard* _board;
28+
BaseSerialInterface* _serial;
29+
bool _connected;
30+
31+
AbstractUITask(mesh::MainBoard* board, BaseSerialInterface* serial) : _board(board), _serial(serial) {
32+
_connected = false;
33+
}
34+
35+
public:
36+
void setHasConnection(bool connected) { _connected = connected; }
37+
bool hasConnection() const { return _connected; }
38+
uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); }
39+
bool isSerialEnabled() const { return _serial->isEnabled(); }
40+
void enableSerial() { _serial->enable(); }
41+
void disableSerial() { _serial->disable(); }
42+
virtual void msgRead(int msgcount) = 0;
43+
virtual void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) = 0;
44+
virtual void soundBuzzer(UIEventType bet = UIEventType::none) = 0;
45+
virtual void loop() = 0;
46+
};

0 commit comments

Comments
 (0)