From 9844ed8dd3438e5deaba146477b80fd2115196b7 Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期三, 19 二月 2025 14:54:41 +0800
Subject: [PATCH] 3.4,提前了看门狗   电量小于1%直接关机

---
 FML/DBG.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/FML/DBG.c b/FML/DBG.c
index 64922be..8e36f9a 100644
--- a/FML/DBG.c
+++ b/FML/DBG.c
@@ -362,6 +362,7 @@
  * Modified Date:    : 2018年7月23日
  *******************************************************************************/
 uint8_t chargedbg_flag;
+extern uint32_t main_time;
 HIDO_VOID DBG_Poll(void)
 {
     if(DBG_GetMode() == DBG_MODE_SHELL)
@@ -382,14 +383,14 @@
             {
                 if(l_u32ModeTick != 0)
                 {
-                    if(HIDO_TimerGetTick() - l_u32ModeTick > 200)
+//                    if(abs(main_time - l_u32ModeTick) >= 1)
                     {
                         DBG_SetMode(DBG_MODE_SHELL);
                     }
                 }
                 else
                 {
-                    l_u32ModeTick = HIDO_TimerGetTick();
+                    l_u32ModeTick = main_time;
                 }
             }
             else
@@ -412,7 +413,7 @@
             {
                 if(l_u32ModeTick != 0)
                 {
-                    if(HIDO_TimerGetTick() - l_u32ModeTick > 200)
+//                    if(abs(main_time - l_u32ModeTick) >= 1)
                     {
                         chargedbg_flag = 1;
                         DBG_SetMode(DBG_MODE_SHELL);
@@ -420,7 +421,7 @@
                 }
                 else
                 {
-                    l_u32ModeTick = HIDO_TimerGetTick();
+                    l_u32ModeTick = main_time;
                 }
             }
             else
@@ -441,7 +442,7 @@
             {
                 if(l_u32ModeTick != 0)
                 {
-                    if(HIDO_TimerGetTick() - l_u32ModeTick > 200)
+//                    if(abs(main_time - l_u32ModeTick) >= 1)
                     {
                         chargedbg_flag = 1;
                         DBG_SetMode(DBG_MODE_SHELL);
@@ -449,7 +450,7 @@
                 }
                 else
                 {
-                    l_u32ModeTick = HIDO_TimerGetTick();
+                     l_u32ModeTick = main_time;
                 }
             }
             else
@@ -476,7 +477,7 @@
     ST_UartInit stInit;
     
     memset(&stInit, 0, sizeof(stInit));
-    stInit.m_eRxMode = UART_RX_MODE_INT;
+    stInit.m_eRxMode = UART_RX_MODE_DMA;
 #if DBG_TX_DMA
     stInit.m_eTxMode = UART_TX_MODE_DMA;
 #else

--
Gitblit v1.9.3