From a09b9d3322edfd764b82d06a584e30b2e72d079f Mon Sep 17 00:00:00 2001 From: Disappear9 Date: Wed, 20 Nov 2024 20:58:37 +0800 Subject: [PATCH 1/3] Prevent ledMessagePin from conflict --- src/msg_utils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/msg_utils.cpp b/src/msg_utils.cpp index fc7821c..27be93c 100644 --- a/src/msg_utils.cpp +++ b/src/msg_utils.cpp @@ -180,8 +180,10 @@ namespace MSG_Utils { if (messageLed && ledOnDelta > 1 * 1000) { digitalWrite(Config.notification.ledMessagePin, LOW); } - if (!messageLed && digitalRead(Config.notification.ledMessagePin) == HIGH) { - digitalWrite(Config.notification.ledMessagePin, LOW); + if (!messageLed && Config.notification.ledMessage){ + if (digitalRead(Config.notification.ledMessagePin) == HIGH){ + digitalWrite(Config.notification.ledMessagePin, LOW); + } } } @@ -550,4 +552,4 @@ namespace MSG_Utils { } } -} \ No newline at end of file +} From b97be0e07b0b8e2f93702d7085cc03f8a0f1773a Mon Sep 17 00:00:00 2001 From: Disappear9 Date: Wed, 20 Nov 2024 21:18:00 +0800 Subject: [PATCH 2/3] Prevent buzzer pin from conflict --- src/menu_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/menu_utils.cpp b/src/menu_utils.cpp index 210bf30..e4017f8 100644 --- a/src/menu_utils.cpp +++ b/src/menu_utils.cpp @@ -647,7 +647,7 @@ namespace MENU_Utils { } #endif #ifdef HAS_AXP2101 - if (Config.notification.lowBatteryBeep && !POWER_Utils::isCharging() && batteryCharge.toInt() < lowBatteryPercent) { + if (Config.notification.buzzerActive && Config.notification.lowBatteryBeep && !POWER_Utils::isCharging() && batteryCharge.toInt() < lowBatteryPercent) { lowBatteryPercent = batteryCharge.toInt(); NOTIFICATION_Utils::lowBatteryBeep(); if (batteryCharge.toInt() < 6) { @@ -686,4 +686,4 @@ namespace MENU_Utils { } } -} \ No newline at end of file +} From ccf7a85de766db4989e898a64de8ef8432a3292e Mon Sep 17 00:00:00 2001 From: Disappear9 Date: Wed, 20 Nov 2024 21:19:55 +0800 Subject: [PATCH 3/3] Prevent buzzer pin from conflict --- src/power_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 6357dc4..18bf2cf 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -461,7 +461,7 @@ namespace POWER_Utils { void shutdown() { logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "SHUTDOWN !!!"); #if defined(HAS_AXP192) || defined(HAS_AXP2101) - if (Config.notification.shutDownBeep) NOTIFICATION_Utils::shutDownBeep(); + if (Config.notification.buzzerActive && Config.notification.shutDownBeep) NOTIFICATION_Utils::shutDownBeep(); displayToggle(false); PMU.shutdown(); #else @@ -494,4 +494,4 @@ namespace POWER_Utils { #endif } -} \ No newline at end of file +}