Skip to content

Commit 1c43d71

Browse files
committed
Merge branch 'master' into develop
2 parents c3a7ad2 + 1523368 commit 1c43d71

File tree

19 files changed

+184
-38
lines changed

19 files changed

+184
-38
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

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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,6 @@ bool Power::setup()
707707
[]() {
708708
power->setIntervalFromNow(0);
709709
runASAP = true;
710-
BaseType_t higherWake = 0;
711710
},
712711
CHANGE);
713712
#endif
@@ -717,7 +716,6 @@ bool Power::setup()
717716
[]() {
718717
power->setIntervalFromNow(0);
719718
runASAP = true;
720-
BaseType_t higherWake = 0;
721719
},
722720
CHANGE);
723721
#endif
@@ -777,7 +775,7 @@ void Power::shutdown()
777775
if (screen) {
778776
#ifdef T_DECK_PRO
779777
screen->showSimpleBanner("Device is powered off.\nConnect USB to start!", 0); // T-Deck Pro has no power button
780-
#elif USE_EINK
778+
#elif defined(USE_EINK)
781779
screen->showSimpleBanner("Shutting Down...", 2250); // dismiss after 3 seconds to avoid the banner on the sleep screen
782780
#else
783781
screen->showSimpleBanner("Shutting Down...", 0); // stays on screen

src/configuration.h

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

256257
// -----------------------------------------------------------------------------
257258
// RAK12035VB Soil Monitor (using RAK12023 up to 3 RAK12035 monitors can be connected)

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: 18 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 {

src/graphics/Screen.cpp

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static int8_t prevFrame = -1;
324324
// Combined dynamic node list frame cycling through LastHeard, HopSignal, and Distance modes
325325
// Uses a single frame and changes data every few seconds (E-Ink variant is separate)
326326

327-
#if defined(ESP_PLATFORM) && defined(USE_ST7789)
327+
#if defined(ESP_PLATFORM) && (defined(USE_ST7789) || defined(USE_ST7796))
328328
SPIClass SPI1(HSPI);
329329
#endif
330330

@@ -356,7 +356,18 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
356356
#else
357357
dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT);
358358
#endif
359+
#elif defined(USE_ST7796)
360+
#ifdef ESP_PLATFORM
361+
dispdev = new ST7796Spi(&SPI1, ST7796_RESET, ST7796_RS, ST7796_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT, ST7796_SDA,
362+
ST7796_MISO, ST7796_SCK, TFT_SPI_FREQUENCY);
363+
#else
364+
dispdev = new ST7796Spi(&SPI1, ST7796_RESET, ST7796_RS, ST7796_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT);
365+
#endif
366+
#if defined(USE_ST7789)
359367
static_cast<ST7789Spi *>(dispdev)->setRGB(TFT_MESH);
368+
#elif defined(USE_ST7796)
369+
static_cast<ST7796Spi *>(dispdev)->setRGB(TFT_MESH);
370+
#endif
360371
#elif defined(USE_SSD1306)
361372
dispdev = new SSD1306Wire(address.address, -1, -1, geometry,
362373
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
@@ -474,6 +485,15 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
474485
pinMode(VTFT_LEDA, OUTPUT);
475486
digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON);
476487
#endif
488+
#endif
489+
#ifdef USE_ST7796
490+
ui->init();
491+
#ifdef ESP_PLATFORM
492+
analogWrite(VTFT_LEDA, BRIGHTNESS_DEFAULT);
493+
#else
494+
pinMode(VTFT_LEDA, OUTPUT);
495+
digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON);
496+
#endif
477497
#endif
478498
enabled = true;
479499
setInterval(0); // Draw ASAP
@@ -512,6 +532,21 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
512532
nrf_gpio_cfg_default(ST7789_NSS);
513533
#endif
514534
#endif
535+
#ifdef USE_ST7796
536+
SPI1.end();
537+
#if defined(ARCH_ESP32)
538+
pinMode(VTFT_LEDA, OUTPUT);
539+
digitalWrite(VTFT_LEDA, LOW);
540+
pinMode(ST7796_RESET, ANALOG);
541+
pinMode(ST7796_RS, ANALOG);
542+
pinMode(ST7796_NSS, ANALOG);
543+
#else
544+
nrf_gpio_cfg_default(VTFT_LEDA);
545+
nrf_gpio_cfg_default(ST7796_RESET);
546+
nrf_gpio_cfg_default(ST7796_RS);
547+
nrf_gpio_cfg_default(ST7796_NSS);
548+
#endif
549+
#endif
515550

516551
#ifdef T_WATCH_S3
517552
PMU->disablePowerOutput(XPOWERS_ALDO2);
@@ -557,6 +592,10 @@ void Screen::setup()
557592
#if defined(MUZI_BASE)
558593
dispdev->delayPoweron = true;
559594
#endif
595+
#if defined(USE_ST7796) && defined(TFT_MESH)
596+
// Custom text color, if defined in variant.h
597+
static_cast<ST7796Spi *>(dispdev)->setRGB(TFT_MESH);
598+
#endif
560599

561600
// === Initialize display and UI system ===
562601
ui->init();
@@ -620,6 +659,8 @@ void Screen::setup()
620659
static_cast<TFTDisplay *>(dispdev)->flipScreenVertically();
621660
#elif defined(USE_ST7789)
622661
static_cast<ST7789Spi *>(dispdev)->flipScreenVertically();
662+
#elif defined(USE_ST7796)
663+
static_cast<ST7796Spi *>(dispdev)->mirrorScreen();
623664
#elif !defined(M5STACK_UNITC6L)
624665
dispdev->flipScreenVertically();
625666
#endif
@@ -652,7 +693,7 @@ void Screen::setup()
652693
touchScreenImpl1->init();
653694
}
654695
}
655-
#elif HAS_TOUCHSCREEN && !defined(USE_EINK)
696+
#elif HAS_TOUCHSCREEN && !defined(USE_EINK) && !HAS_CST226SE
656697
touchScreenImpl1 =
657698
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
658699
touchScreenImpl1->init();

src/graphics/Screen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class Screen
8383
#include <ST7789Spi.h>
8484
#elif defined(USE_SPISSD1306)
8585
#include <SSD1306Spi.h>
86+
#elif defined(USE_ST7796)
87+
#include <ST7796Spi.h>
8688
#else
8789
// the SH1106/SSD1306 variant is auto-detected
8890
#include <AutoOLEDWire.h>

src/graphics/ScreenFonts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#endif
7474

7575
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
76-
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS)) && \
76+
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) || defined(USE_ST7796)) && \
7777
!defined(DISPLAY_FORCE_SMALL_FONTS)
7878
// The screen is bigger so use bigger fonts
7979
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19

0 commit comments

Comments
 (0)