From 81c6eacbe89801592f01f0e573b72d8547e3867b Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期二, 08 七月 2025 11:17:28 +0800
Subject: [PATCH] V3.3 增加10分钟超时保护,确认公网专网都能升级

---
 keil/include/src/OTA.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/keil/include/src/OTA.c b/keil/include/src/OTA.c
index 0783f1f..ede1999 100644
--- a/keil/include/src/OTA.c
+++ b/keil/include/src/OTA.c
@@ -27,7 +27,7 @@
 #define MAX_REQUEST_SIZE                    (5 * 1024)
 #define APP2_ADRESS 0x0402f000
 //#define APP_SIZE 0x04080000-APP2_ADRESS
-#define APP_CONFIG_APPLICATION_SIZE                         0x19000          //4K对齐
+#define APP_CONFIG_APPLICATION_SIZE                         0x20000          //4K对齐
 /*******************************************************************************
  *                             Type Definition                                 *
  *******************************************************************************/
@@ -259,7 +259,7 @@
  * Author            : www.hido-studio.com
  * Modified Date:    : 2020年9月13日
  *******************************************************************************/
-static HIDO_INT32 OTA_Failed(void)
+HIDO_INT32 OTA_Failed(void)
 {
     uint16_t tmp = 0xFFFF;
     __disable_irq();
@@ -364,6 +364,7 @@
     else
     {
         l_eOTAType = OTA_TYPE_MUSIC;
+        flash_erase(FLASH_ID0, APP2_ADRESS, APP_CONFIG_APPLICATION_SIZE);
     }
 
     /* 请求升级文件长度 */

--
Gitblit v1.9.3