From 060a3bde4d1d708ee42f91090e54198cc6eef177 Mon Sep 17 00:00:00 2001
From: virgil <virgil.wang.cj@gmail.com>
Date: Thu, 28 Nov 2024 20:19:18 +0800
Subject: [PATCH] fix: Solve the lightsleep crash problem via disable 
 lightsleep for indicator. (#5470)

---
 src/mesh/NodeDB.cpp | 2 +-
 src/sleep.cpp       | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp
index b529fa934..b38f55ae6 100644
--- a/src/mesh/NodeDB.cpp
+++ b/src/mesh/NodeDB.cpp
@@ -542,7 +542,7 @@ void NodeDB::initConfigIntervals()
 
     config.display.screen_on_secs = default_screen_on_secs;
 
-#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014) || defined(SENSECAP_INDICATOR)
+#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014)
     config.power.is_power_saving = true;
     config.display.screen_on_secs = 30;
     config.power.wait_bluetooth_secs = 30;
diff --git a/src/sleep.cpp b/src/sleep.cpp
index 05597cdfa..904bc3ab8 100644
--- a/src/sleep.cpp
+++ b/src/sleep.cpp
@@ -336,6 +336,11 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
 {
     // LOG_DEBUG("Enter light sleep");
 
+    //LORA_DIO1 is an extended IO pin. Setting it as a wake-up pin will cause problems, such as the indicator device not entering LightSleep.
+#if defined(SENSECAP_INDICATOR)
+    return ESP_SLEEP_WAKEUP_TIMER;
+#endif
+
     waitEnterSleep(false);
 
     uint64_t sleepUsec = sleepMsec * 1000LL;