From aa14c757b47b2ef43ec8a6ced81fefe1e6594d2d Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期三, 12 十一月 2025 13:35:09 +0800
Subject: [PATCH] 1

---
 STM32H743/APL/app.c |   48 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/STM32H743/APL/app.c b/STM32H743/APL/app.c
index 4ca81fd..f4a74fb 100644
--- a/STM32H743/APL/app.c
+++ b/STM32H743/APL/app.c
@@ -14,26 +14,50 @@
 #include "bluetooth.h"
 
 static osSemaphoreId_t g_semaphoreHandle = NULL;
+extern uint8_t restart_num;
+void IdleTask(void)
+{
+        if(g_com_map[CNT_RESTART]==1)
+        {
+            g_com_map[CNT_RESTART]=0;
+//            printf("%s URTRestart",__debug_info__);
+            HAL_NVIC_SystemReset();
+        }
+            if(g_com_map[MAP_SIGN_INDEX]!=0x55AA)
+        {
+//            printf("%s URTRestart",__debug_info__);
+            HAL_NVIC_SystemReset();
+              //  SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader
+        }
 
+    }
 void app_task(void *pvParameters)
 {
+    g_com_map[IP_0] =103;
+    g_com_map[IP_1] =155;
+    g_com_map[IP_2] =76;
+    g_com_map[IP_3] =198;
+    g_com_map[UDP_PORT] =6666;
+    Shell_Init();
     GPS_Init();
     Internet_Init();
     UDPClient_Init();
 
     while (1)
     {
-        HIDO_UINT32 timeout = HIDO_TimerGetNearestTimeout(1000);
+        //HIDO_UINT32 timeout = HIDO_TimerGetNearestTimeout(1000);
+        HIDO_UINT32 timeout = 100;
         if (xSemaphoreTake(g_semaphoreHandle, timeout / portTICK_PERIOD_MS) == pdTRUE)
         {
-            DBG_Poll();
-			BT_Poll();
-            HIDO_ATLitePoll();
-            Internet_Poll();
-            GPS_Poll();
-            UDPClient_Poll();
-        }
 
+        }
+        DBG_Poll();
+        BT_Poll();
+        HIDO_ATLitePoll();
+        Internet_Poll();
+        GPS_Poll();
+        UDPClient_Poll();
+        IdleTask();
         HIDO_TimerPoll();
     }
 }
@@ -53,6 +77,14 @@
     }
 }
 
+void app_trigger(void)
+{
+    if (g_semaphoreHandle != NULL)
+    {
+        xSemaphoreGive(g_semaphoreHandle);
+    }
+}
+
 void app_main(void)
 {
     MCUFlash_Init();

--
Gitblit v1.9.3