Skip to content

Commit 672e7fb

Browse files
authored
Merge branch 'meshtastic:master' into master
2 parents 9b927ea + a6cdf2c commit 672e7fb

Some content is hidden

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

48 files changed

+1132
-62
lines changed

.trunk/trunk.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ cli:
44
plugins:
55
sources:
66
- id: trunk
7-
ref: v1.7.3
7+
ref: v1.7.4
88
uri: https://github.com/trunk-io/plugins
99
lint:
1010
enabled:
11-
12-
- renovate@42.5.4
11+
12+
- renovate@42.24.1
1313
14-
- trufflehog@3.90.13
14+
- trufflehog@3.91.1
1515
16-
- bandit@1.8.6
16+
- bandit@1.9.2
1717
1818
19-
19+
2020
21-
- markdownlint@0.45.0
21+
- markdownlint@0.46.0
2222
2323
24-
24+
2525
2626
2727
2828
2929
3030
- git-diff-check
31-
- gitleaks@8.29.0
31+
- gitleaks@8.30.0
3232
3333
ignore:
3434
- linters: [ALL]

arch/stm32/stm32.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
extends = arduino_base
33
platform =
44
# renovate: datasource=custom.pio depName=platformio/ststm32 packageName=platformio/platform/ststm32
5-
platformio/ststm32@19.3.0
5+
platformio/ststm32@19.4.0
66
platform_packages =
77
# TODO renovate
88
platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip

boards/ThinkNode-M3.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "nrf52840_s140_v6.ld"
5+
},
6+
"core": "nRF5",
7+
"cpu": "cortex-m4",
8+
"extra_flags": "-DNRF52840_XXAA",
9+
"f_cpu": "64000000L",
10+
"hwids": [
11+
["0x239A", "0x4405"],
12+
["0x239A", "0x0029"],
13+
["0x239A", "0x002A"]
14+
],
15+
"usb_product": "elecrow_eink",
16+
"mcu": "nrf52840",
17+
"variant": "ELECROW-ThinkNode-M3",
18+
"variants_dir": "variants",
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": ["bluetooth"],
33+
"debug": {
34+
"jlink_device": "nRF52840_xxAA",
35+
"onboard_tools": ["jlink"],
36+
"svd_path": "nrf52840.svd",
37+
"openocd_target": "nrf52840-mdk-rs"
38+
},
39+
"frameworks": ["arduino"],
40+
"name": "elecrow nrf",
41+
"upload": {
42+
"maximum_ram_size": 248832,
43+
"maximum_size": 815104,
44+
"speed": 115200,
45+
"protocol": "nrfutil",
46+
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
47+
"use_1200bps_touch": true,
48+
"require_upload_port": true,
49+
"wait_for_upload_port": true
50+
},
51+
"url": "",
52+
"vendor": "ELECROW"
53+
}

boards/muzi-base.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "nrf52840_s140_v6.ld"
5+
},
6+
"core": "nRF5",
7+
"cpu": "cortex-m4",
8+
"extra_flags": "-DARDUINO_NRF52840_MUZI_BASE -DNRF52840_XXAA",
9+
"f_cpu": "64000000L",
10+
"hwids": [["0x239A", "0xcafe"]],
11+
"mcu": "nrf52840",
12+
"variant": "muzi-base",
13+
"variants_dir": "variants",
14+
"bsp": {
15+
"name": "adafruit"
16+
},
17+
"softdevice": {
18+
"sd_flags": "-DS140",
19+
"sd_name": "s140",
20+
"sd_version": "6.1.1",
21+
"sd_fwid": "0x00B6"
22+
},
23+
"bootloader": {
24+
"settings_addr": "0xFF000"
25+
}
26+
},
27+
"connectivity": ["bluetooth"],
28+
"debug": {
29+
"jlink_device": "nRF52840_xxAA",
30+
"onboard_tools": ["jlink"],
31+
"svd_path": "nrf52840.svd",
32+
"openocd_target": "nrf52840-mdk-rs"
33+
},
34+
"frameworks": ["arduino"],
35+
"name": "Muzi Base",
36+
"url": "https://muzi.works/",
37+
"vendor": "MuziWorks",
38+
"upload": {
39+
"maximum_ram_size": 248832,
40+
"maximum_size": 815104,
41+
"speed": 115200,
42+
"protocol": "nrfutil",
43+
"protocols": [
44+
"jlink",
45+
"nrfjprog",
46+
"nrfutil",
47+
"blackmagic",
48+
"cmsis-dap",
49+
"mbed",
50+
"stlink"
51+
],
52+
"use_1200bps_touch": true,
53+
"require_upload_port": true,
54+
"wait_for_upload_port": true
55+
}
56+
}

platformio.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ framework = arduino
9090
lib_deps =
9191
${env.lib_deps}
9292
# renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL
93-
end2endzone/NonBlockingRTTTL@1.3.0
93+
end2endzone/NonBlockingRTTTL@1.4.0
9494
build_flags = ${env.build_flags} -Os
9595
build_src_filter = ${env.build_src_filter} -<platform/portduino/> -<graphics/niche/>
9696

@@ -169,7 +169,7 @@ lib_deps =
169169
# renovate: datasource=git-refs depName=DFRobot_RainfallSensor packageName=https://github.com/DFRobot/DFRobot_RainfallSensor gitBranch=master
170170
https://github.com/DFRobot/DFRobot_RainfallSensor/archive/38fea5e02b40a5430be6dab39a99a6f6347d667e.zip
171171
# renovate: datasource=custom.pio depName=INA226 packageName=robtillaart/library/INA226
172-
robtillaart/[email protected].4
172+
robtillaart/[email protected].5
173173
# renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library
174174
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor [email protected]
175175
# renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library
@@ -213,6 +213,6 @@ lib_deps =
213213
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
214214
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
215215
# renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core
216-
sensirion/Sensirion [email protected].1
216+
sensirion/Sensirion [email protected].2
217217
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
218218
sensirion/Sensirion I2C [email protected]

src/Power.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ class AnalogBatteryLevel : public HasBatteryLevel
278278
break;
279279
}
280280
}
281+
#if defined(BATTERY_CHARGING_INV)
282+
// bit of trickery to show 99% up until the charge finishes
283+
if (!digitalRead(BATTERY_CHARGING_INV) && battery_SOC > 99)
284+
battery_SOC = 99;
285+
#endif
281286
return clamp((int)(battery_SOC), 0, 100);
282287
}
283288

@@ -455,6 +460,8 @@ class AnalogBatteryLevel : public HasBatteryLevel
455460
}
456461
// if it's not HIGH - check the battery
457462
#endif
463+
#elif defined(MUZI_BASE)
464+
return NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk;
458465
#endif
459466
return getBattVoltage() > chargingVolt;
460467
}
@@ -470,6 +477,8 @@ class AnalogBatteryLevel : public HasBatteryLevel
470477
#endif
471478
#ifdef EXT_CHRG_DETECT
472479
return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value;
480+
#elif defined(BATTERY_CHARGING_INV)
481+
return !digitalRead(BATTERY_CHARGING_INV);
473482
#else
474483
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(DISABLE_INA_CHARGING_DETECTION)
475484
if (hasINA()) {
@@ -698,11 +707,18 @@ bool Power::setup()
698707
[]() {
699708
power->setIntervalFromNow(0);
700709
runASAP = true;
701-
BaseType_t higherWake = 0;
702710
},
703711
CHANGE);
704712
#endif
705-
713+
#ifdef BATTERY_CHARGING_INV
714+
attachInterrupt(
715+
BATTERY_CHARGING_INV,
716+
[]() {
717+
power->setIntervalFromNow(0);
718+
runASAP = true;
719+
},
720+
CHANGE);
721+
#endif
706722
enabled = found;
707723
low_voltage_counter = 0;
708724

@@ -759,6 +775,8 @@ void Power::shutdown()
759775
if (screen) {
760776
#ifdef T_DECK_PRO
761777
screen->showSimpleBanner("Device is powered off.\nConnect USB to start!", 0); // T-Deck Pro has no power button
778+
#elif defined(USE_EINK)
779+
screen->showSimpleBanner("Shutting Down...", 2250); // dismiss after 3 seconds to avoid the banner on the sleep screen
762780
#else
763781
screen->showSimpleBanner("Shutting Down...", 0); // stays on screen
764782
#endif

src/configuration.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
252252
// Touchscreen
253253
// -----------------------------------------------------------------------------
254254
#define FT6336U_ADDR 0x48
255-
#define CST328_ADDR 0x1A
255+
#define CST328_ADDR 0x1A // same address as CST226SE
256256
#define CHSC6X_ADDR 0x2E
257+
#define CST226SE_ADDR_ALT 0x5A
257258

258259
// -----------------------------------------------------------------------------
259260
// RAK12035VB Soil Monitor (using RAK12023 up to 3 RAK12035 monitors can be connected)
@@ -398,6 +399,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
398399
#define HAS_RGB_LED
399400
#endif
400401

402+
#ifndef LED_STATE_OFF
403+
#define LED_STATE_OFF 0
404+
#endif
405+
#ifndef LED_STATE_ON
406+
#define LED_STATE_ON 1
407+
#endif
408+
401409
// default mapping of pins
402410
#if defined(PIN_BUTTON2) && !defined(CANCEL_BUTTON_PIN)
403411
#define ALT_BUTTON_PIN PIN_BUTTON2

src/detect/ScanI2C.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ class ScanI2C
8585
DRV2605,
8686
BH1750,
8787
DA217,
88-
CHSC6X
88+
CHSC6X,
89+
CST226SE
8990
} DeviceType;
9091

9192
// typedef uint8_t DeviceAddress;

src/detect/ScanI2CTwoWire.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,18 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
499499
SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address);
500500
SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address);
501501
SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address);
502-
SCAN_SIMPLE_CASE(CST328_ADDR, CST328, "CST328", (uint8_t)addr.address);
502+
case CST328_ADDR:
503+
// Do we have the CST328 or the CST226SE
504+
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1);
505+
if (registerValue == 0xA9) {
506+
type = CST226SE;
507+
logFoundDevice("CST226SE", (uint8_t)addr.address);
508+
} else {
509+
type = CST328;
510+
logFoundDevice("CST328", (uint8_t)addr.address);
511+
}
512+
break;
513+
503514
SCAN_SIMPLE_CASE(CHSC6X_ADDR, CHSC6X, "CHSC6X", (uint8_t)addr.address);
504515
case LTR553ALS_ADDR:
505516
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x86), 1); // Part ID register
@@ -528,8 +539,12 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
528539
#endif
529540

530541
case MLX90614_ADDR_DEF:
531-
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1);
532-
if (registerValue == 0x5a) {
542+
// Do we have the MLX90614 or the MPR121KB or the CST226SE
543+
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x06), 1);
544+
if (registerValue == 0xAB) {
545+
type = CST226SE;
546+
logFoundDevice("CST226SE", (uint8_t)addr.address);
547+
} else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1) == 0x5a) {
533548
type = MLX90614;
534549
logFoundDevice("MLX90614", (uint8_t)addr.address);
535550
} else {
@@ -547,6 +562,11 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
547562
case ICM20948_ADDR: // same as BMX160_ADDR
548563
case ICM20948_ADDR_ALT: // same as MPU6050_ADDR
549564
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
565+
#ifdef HAS_ICM20948
566+
type = ICM20948;
567+
logFoundDevice("ICM20948", (uint8_t)addr.address);
568+
break;
569+
#endif
550570
if (registerValue == 0xEA) {
551571
type = ICM20948;
552572
logFoundDevice("ICM20948", (uint8_t)addr.address);

src/gps/RTC.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ RTCSetResult readFromRTC()
112112
#elif defined(RX8130CE_RTC)
113113
if (rtc_found.address == RX8130CE_RTC) {
114114
uint32_t now = millis();
115+
#ifdef MUZI_BASE
116+
ArtronShop_RX8130CE rtc(&Wire1);
117+
#else
115118
ArtronShop_RX8130CE rtc(&Wire);
119+
#endif
116120
tm t;
117121
if (rtc.getTime(&t)) {
118122
tv.tv_sec = gm_mktime(&t);
@@ -245,7 +249,11 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd
245249
}
246250
#elif defined(RX8130CE_RTC)
247251
if (rtc_found.address == RX8130CE_RTC) {
252+
#ifdef MUZI_BASE
253+
ArtronShop_RX8130CE rtc(&Wire1);
254+
#else
248255
ArtronShop_RX8130CE rtc(&Wire);
256+
#endif
249257
tm *t = gmtime(&tv->tv_sec);
250258
if (rtc.setTime(*t)) {
251259
LOG_DEBUG("RX8130CE setDateTime %02d-%02d-%02d %02d:%02d:%02d (%ld)", t->tm_year + 1900, t->tm_mon + 1,

0 commit comments

Comments
 (0)