From 4a3e0d8391f0720ed5f129dcad3d96ac090acf69 Mon Sep 17 00:00:00 2001 From: Robofish <1683502971@qq.com> Date: Sat, 24 Jan 2026 01:57:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0G4=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data_interface.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/data_interface.py b/app/data_interface.py index d51d327..4474a1a 100644 --- a/app/data_interface.py +++ b/app/data_interface.py @@ -456,11 +456,19 @@ class DataInterface(QWidget): def generate_freertos_task(self): import re - freertos_path = os.path.join(self.project_path, "Core", "Src", "freertos.c") - if not os.path.exists(freertos_path): + # 尝试查找 freertos.c 或 app_freertos.c (G4系列使用 app_freertos.c) + freertos_path = None + possible_names = ["freertos.c", "app_freertos.c"] + for name in possible_names: + path = os.path.join(self.project_path, "Core", "Src", name) + if os.path.exists(path): + freertos_path = path + break + + if not freertos_path: InfoBar.error( - title="未找到 freertos.c", - content="未找到 Core/Src/freertos.c 文件,请确认工程路径。", + title="未找到 FreeRTOS 文件", + content="未找到 Core/Src/freertos.c 或 Core/Src/app_freertos.c 文件,请确认工程路径。", parent=self, duration=2500 )