启动顺序管理

This commit is contained in:
2026-08-29 11:10:08 +08:00
parent 652efb848d
commit 0b59118ddd
13 changed files with 351 additions and 84 deletions
+5 -5
View File
@@ -11,23 +11,24 @@
#include <string.h>
#include "ch395f_test_task.h"
#include "ch395f_test.h"
#include "net_test_task.h"
#include "cmsis_os.h"
#include "net_task.h"
#include "net_socket.h"
#include "ch395f_test.h"
#include "ch395f.h"
#include "test_config.h"
#include "storage_test.h"
#include "gd5f_test.h"
#include "sd2506_test.h"
#include "sys_events.h"
#define DBG_TAG "[TEST_TASK]"
#include "dbg_log.h"
/* netTask 初始化完成标志(由 net_task.c 在 net_stack_bring_up 成功后置 1)。
* 仅 NET 层模式使用 —— 硬件层模式下 netTask 不创建,由本任务自行初始化。 */
extern volatile uint8_t g_net_ready;
/*
* 全局测试统计数据,由 TEST_CHECK/TEST_REPORT 宏自动管理。
@@ -1381,9 +1382,8 @@ void ch395f_test_run(void)
/* NET 层模式(阶段 6~11):等待 netTask 完成 net_init() 及 CH395F 初始化。
* Phase 7(TCP Client)与阶段 6/8~11(TCP Server 监听循环)互斥,
* 二者共用单连接 Socket 0,故按宏选择入口。 */
while (!g_net_ready) {
osDelay(100);
}
/* 等待 netTask 广播网络就绪(取代 g_net_ready 忙等轮询) */
(void)osEventFlagsWait(sys_evtHandle, SYS_EVT_NET_READY, osFlagsWaitAny, osWaitForever);
DBG_INFO("netTask ready");
#if defined(ENABLE_PHASE7_TESTS)
net_layer_client_test_main();