mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 02:02:23 +00:00
resolve #2364
- fix wrong debug print - change shutdown logic for t-beam if PMU is detected - wait for 10 seconds instead of 5 for shutdown and resurrect screen brightness adjust for @karamo
This commit is contained in:
@@ -123,14 +123,12 @@ class ButtonThread : public concurrency::OSThread
|
||||
static void userButtonPressedLong()
|
||||
{
|
||||
// LOG_DEBUG("Long press!\n");
|
||||
// If user button is held down for 5 seconds, shutdown the device.
|
||||
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
||||
#ifdef HAS_PMU
|
||||
if (pmu_found == true) {
|
||||
setLed(false);
|
||||
power->shutdown();
|
||||
}
|
||||
#elif defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||
if (screen_found == true) {
|
||||
screen->adjustBrightness();
|
||||
}
|
||||
// If user button is held down for 10 seconds, shutdown the device.
|
||||
if ((millis() - longPressTime > 10000) && (longPressTime > 0)) {
|
||||
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||
// Do actual shutdown when button released, otherwise the button release
|
||||
// may wake the board immediatedly.
|
||||
if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) {
|
||||
|
||||
Reference in New Issue
Block a user