From 802d577c38746ffd416d86d8a54ab0a5ad618089 Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期二, 11 六月 2024 11:42:58 +0800
Subject: [PATCH] 铁鞋2.8,加入了充电时候如果没有测距30s重启的机制

---
 Core/Src/main.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Core/Src/main.c b/Core/Src/main.c
index e279520..c3fd7fe 100644
--- a/Core/Src/main.c
+++ b/Core/Src/main.c
@@ -119,6 +119,7 @@
 uint8_t nomove_flag;
 uint16_t irq_num;
 uint16_t nomove_count;
+uint16_t debug1,debug2,debug3,debug4;
 void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
 {
     if(GPIO_Pin == RADIO_DIO1_Pin)
@@ -126,11 +127,17 @@
 //        SystemClock_Config();
 //        irq_num++;
 //        RadioIrqProcess();
+        debug1++;
     }
     if(GPIO_Pin == GPIO_PIN_9)
     {
         SystemClock_Config();
             MbxTagUwbRec();  
+        debug2++;
+    }
+    if(GPIO_Pin == GPIO_PIN_13)
+    {
+debug3++;
     }
 //    if(GPIO_Pin == GPIO_PIN_1)//按键
 //    {
@@ -193,6 +200,7 @@
   /* USER CODE END SysInit */
 
   /* Initialize all configured peripherals */
+  MX_IWDG_Init();
   MX_GPIO_Init();
   MX_DMA_Init();
   MX_RTC_Init();
@@ -203,7 +211,6 @@
   MX_LPTIM1_Init();
   MX_USART1_UART_Init();
   MX_TIM3_Init();
-  MX_IWDG_Init();
   /* USER CODE BEGIN 2 */
 //   __disable_irq();
   Uart_Register(UART_ID_DBG, &huart1);
@@ -231,7 +238,7 @@
 //  dwt_entersleep();
   LIS3DH_Data_Init();	
   HAL_Delay(500);
-  LoraInit();
+//  LoraInit();
   if (HAL_LPTIM_TimeOut_Start_IT(&hlptim1, LPTIMER_1S_COUNT, 0) != HAL_OK)  //system time is 1010ms   1 puls=30.518us
   {
      Error_Handler();
@@ -836,6 +843,7 @@
 uint8_t num;
 uint16_t sleep_time;
 uint16_t chongdian_yundong_time;
+uint16_t chongdianmeiyouuwb_time;
 void Bat_Percent_Poll()
 {
     bat_time++;
@@ -937,6 +945,7 @@
     SystemClock_Config();
     Gps_Chongqi_Poll();
     Powerled_Poll();
+    chongdianmeiyouuwb_time++;
     if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)&&chongman_flag==0)
     {
         num++;

--
Gitblit v1.9.3