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%直接关机

---
 Core/Src/main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Core/Src/main.c b/Core/Src/main.c
index 3e508d7..589cdcb 100644
--- a/Core/Src/main.c
+++ b/Core/Src/main.c
@@ -131,7 +131,7 @@
 void mcu_sleep(void)
 {
     GPIO_InitTypeDef GPIO_InitStruct = { 0 };
-//    LIS3DH_Data_Init();
+    LIS3DH_Data_Init();
 //        while(1)
 //    {}
 //        HAL_NVIC_SystemReset();
@@ -178,7 +178,7 @@
 {
     if(GPIO_Pin == GPIO_PIN_12)
     {
-//        SystemClock_Config();
+         SystemClock_Config();
         PowerDownDetect();
     }
     if(GPIO_Pin == GPIO_PIN_9)
@@ -200,7 +200,7 @@
     if(GPIO_Pin == GPIO_PIN_0)//加速度
     {
          SystemClock_Config();
-        if(nomove_flag==1)
+        if(nomove_flag||stop_flag)
         {
         HAL_NVIC_SystemReset();
         }
@@ -253,6 +253,7 @@
   /* USER CODE END SysInit */
 
   /* Initialize all configured peripherals */
+  MX_IWDG_Init();
   MX_GPIO_Init();
   MX_DMA_Init();
   MX_RTC_Init();
@@ -263,7 +264,6 @@
   MX_LPTIM1_Init();
   MX_USART1_UART_Init();
   MX_TIM3_Init();
-  MX_IWDG_Init();
   MX_LPUART1_UART_Init();
   /* USER CODE BEGIN 2 */
 //   __disable_irq();

--
Gitblit v1.9.3