Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
merge-multiple: true

- name: Test Report
uses: dorny/test-reporter@v2.4.0
uses: dorny/test-reporter@v2.5.0
with:
name: PlatformIO Tests
path: testreport.xml
Expand Down
6 changes: 3 additions & 3 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins:
uri: https://github.com/trunk-io/plugins
lint:
enabled:
- checkov@3.2.496
- renovate@42.66.14
- checkov@3.2.497
- renovate@42.71.2
- prettier@3.7.4
- trufflehog@3.92.4
- yamllint@1.37.1
Expand All @@ -21,7 +21,7 @@ lint:
- markdownlint@0.47.0
- oxipng@10.0.0
- svgo@4.0.0
- actionlint@1.7.9
- actionlint@1.7.10
- flake8@7.3.0
- hadolint@2.14.0
- shfmt@3.6.0
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ lib_deps =
[device-ui_base]
lib_deps =
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
https://github.com/meshtastic/device-ui/archive/a8e2f947f7abaf0c5ac8e6dd189a22156335beaa.zip
https://github.com/meshtastic/device-ui/archive/272defcb35651461830ebfd1b39c9167c8f49317.zip

; Common libs for environmental measurements in telemetry module
[environmental_base]
Expand Down
2 changes: 1 addition & 1 deletion protobufs
2 changes: 1 addition & 1 deletion src/detect/ScanI2CTwoWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
if (r == 0x08 || r == 0x00) {
logFoundDevice("SH1106", (uint8_t)addr.address);
o_probe = SCREEN_SH1106; // SH1106
} else if (r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) {
} else if (r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07 || r == 0x05) {
logFoundDevice("SSD1306", (uint8_t)addr.address);
o_probe = SCREEN_SSD1306; // SSD1306
}
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/EInkDisplay2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ bool EInkDisplay::connect()
#endif
#endif

#if defined(TTGO_T_ECHO) || defined(ELECROW_ThinkNode_M1) || defined(T_ECHO_LITE)
#if defined(TTGO_T_ECHO) || defined(ELECROW_ThinkNode_M1) || defined(T_ECHO_LITE) || defined(TTGO_T_ECHO_PLUS)
{
auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, SPI1);

Expand Down
9 changes: 8 additions & 1 deletion src/input/ButtonThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ bool ButtonThread::initButton(const ButtonConfig &config)
_activeLow = config.activeLow;
_touchQuirk = config.touchQuirk;
_intRoutine = config.intRoutine;
_pressHandler = config.onPress;
_releaseHandler = config.onRelease;
_suppressLeadUp = config.suppressLeadUpSound;
_longLongPress = config.longLongPress;

userButton = OneButton(config.pinNumber, config.activeLow, config.activePullup);
Expand Down Expand Up @@ -133,14 +136,16 @@ int32_t ButtonThread::runOnce()

// Detect start of button press
if (buttonCurrentlyPressed && !buttonWasPressed) {
if (_pressHandler)
_pressHandler();
buttonPressStartTime = millis();
leadUpPlayed = false;
leadUpSequenceActive = false;
resetLeadUpSequence();
}

// Progressive lead-up sound system
if (buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS) {
if (!_suppressLeadUp && buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS) {

// Start the progressive sequence if not already active
if (!leadUpSequenceActive) {
Expand All @@ -160,6 +165,8 @@ int32_t ButtonThread::runOnce()

// Reset when button is released
if (!buttonCurrentlyPressed && buttonWasPressed) {
if (_releaseHandler)
_releaseHandler();
leadUpSequenceActive = false;
resetLeadUpSequence();
}
Expand Down
6 changes: 6 additions & 0 deletions src/input/ButtonThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ struct ButtonConfig {
bool activePullup = true;
uint32_t pullupSense = 0;
voidFuncPtr intRoutine = nullptr;
voidFuncPtr onPress = nullptr; // Optional edge callbacks
voidFuncPtr onRelease = nullptr; // Optional edge callbacks
bool suppressLeadUpSound = false;
input_broker_event singlePress = INPUT_BROKER_NONE;
input_broker_event longPress = INPUT_BROKER_NONE;
uint16_t longPressTime = 500;
Expand Down Expand Up @@ -94,6 +97,9 @@ class ButtonThread : public Observable<const InputEvent *>, public concurrency::
input_broker_event _shortLong = INPUT_BROKER_NONE;

voidFuncPtr _intRoutine = nullptr;
voidFuncPtr _pressHandler = nullptr;
voidFuncPtr _releaseHandler = nullptr;
bool _suppressLeadUp = false;
uint16_t _longPressTime = 500;
uint16_t _longLongPressTime = 3900;
int _pinNum = 0;
Expand Down
34 changes: 30 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;

#if defined(BUTTON_PIN_TOUCH)
ButtonThread *TouchButtonThread = nullptr;
#if defined(TTGO_T_ECHO_PLUS) && defined(PIN_EINK_EN)
static bool touchBacklightWasOn = false;
static bool touchBacklightActive = false;
#endif
#endif

#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
Expand Down Expand Up @@ -205,7 +209,7 @@ ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE,
/// The I2C address of our Air Quality Indicator (if found)
ScanI2C::DeviceAddress aqi_found = ScanI2C::ADDRESS_NONE;

#if defined(T_WATCH_S3) || defined(T_LORA_PAGER)
#ifdef HAS_DRV2605
Adafruit_DRV2605 drv;
#endif

Expand Down Expand Up @@ -795,7 +799,6 @@ void setup()
// We do this as early as possible because this loads preferences from flash
// but we need to do this after main cpu init (esp32setup), because we need the random seed set
nodeDB = new NodeDB;

#if HAS_TFT
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
tftSetup();
Expand Down Expand Up @@ -841,7 +844,12 @@ void setup()
#endif
#endif

#if defined(T_WATCH_S3) || defined(T_LORA_PAGER)
#ifdef HAS_DRV2605
#if defined(PIN_DRV_EN)
pinMode(PIN_DRV_EN, OUTPUT);
digitalWrite(PIN_DRV_EN, HIGH);
delay(10);
#endif
drv.begin();
drv.selectLibrary(1);
// I2C trigger by sending 'go' command
Expand Down Expand Up @@ -877,7 +885,7 @@ void setup()
SPI.begin();
#endif
#else
// ESP32
// ESP32
#if defined(HW_SPI1_DEVICE)
SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
Expand Down Expand Up @@ -1046,6 +1054,24 @@ void setup()
};
touchConfig.singlePress = INPUT_BROKER_NONE;
touchConfig.longPress = INPUT_BROKER_BACK;
#if defined(TTGO_T_ECHO_PLUS) && defined(PIN_EINK_EN)
// On T-Echo Plus the touch pad should only drive the backlight, not UI navigation/sounds
touchConfig.longPress = INPUT_BROKER_NONE;
touchConfig.suppressLeadUpSound = true;
touchConfig.onPress = []() {
touchBacklightWasOn = uiconfig.screen_brightness == 1;
if (!touchBacklightWasOn) {
digitalWrite(PIN_EINK_EN, HIGH);
}
touchBacklightActive = true;
};
touchConfig.onRelease = []() {
if (touchBacklightActive && !touchBacklightWasOn) {
digitalWrite(PIN_EINK_EN, LOW);
}
touchBacklightActive = false;
};
#endif
TouchButtonThread->initButton(touchConfig);
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern bool eink_found;
extern bool pmu_found;
extern bool isUSBPowered;

#if defined(T_WATCH_S3) || defined(T_LORA_PAGER)
#ifdef HAS_DRV2605
#include <Adafruit_DRV2605.h>
extern Adafruit_DRV2605 drv;
#endif
Expand Down
1 change: 1 addition & 0 deletions src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,7 @@ void NodeDB::addFromContact(meshtastic_SharedContact contact)
// If should_ignore is set,
// we need to clear the public key and other cruft, in addition to setting the node as ignored
info->is_ignored = true;
info->is_muted = true;
info->is_favorite = false;
info->has_device_metrics = false;
info->has_position = false;
Expand Down
3 changes: 3 additions & 0 deletions src/mesh/generated/meshtastic/admin.pb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ PB_BIND(meshtastic_AdminMessage, meshtastic_AdminMessage, 2)
PB_BIND(meshtastic_AdminMessage_InputEvent, meshtastic_AdminMessage_InputEvent, AUTO)


PB_BIND(meshtastic_AdminMessage_OTAEvent, meshtastic_AdminMessage_OTAEvent, AUTO)


PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO)


Expand Down
Loading
Loading