Files
STM32F4-Base/test/board/test_config.c
T

51 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/******************************************************************************
* 模块名称:统一测试任务调度器(Test Config)
* 模块功能:所有测试任务的唯一入口。FreeRTOS 的 testTask 仅调用本文件
* 的 start_test_task(),由本文件根据 test_config.h 中启用的
* TEST_SUITE_* 宏,将测试分发到对应套件的运行函数。
*
* 各套件运行函数(ch395f_test_run / storage_test_run / gd5f_test_run
* / sd2506_test_run)各自实现具体测试逻辑,本文件只负责"选哪个跑",
* 不掺杂任何具体测试细节,使测试入口界限清晰、易于维护。
* 作者:王建锋
* 创建日期:2026-08-29
******************************************************************************/
#define DBG_TAG "[TEST_CFG]"
#include "cmsis_os.h"
#include "dbg_log.h"
#include "test_config.h"
#include "ch395f_test_task.h"
#include "storage_test.h"
#include "gd5f_test.h"
#include "sd2506_test.h"
/*
* 测试任务统一入口(FreeRTOS start_test_task 线程函数)。
* 根据编译期选中的 TEST_SUITE_* 调度对应套件,其余时间挂起。
*/
void start_test_task(void *argument)
{
(void)argument;
DBG_INFO("Test task started, suite=%s", TEST_SUITE_NAME);
#if defined(TEST_SUITE_CH395F)
ch395f_test_run();
#elif defined(TEST_SUITE_STORAGE)
storage_test_run();
#elif defined(TEST_SUITE_GD5F)
gd5f_test_run();
#elif defined(TEST_SUITE_RTC)
sd2506_test_run();
#else
DBG_INFO("No test suite selected (normal product build)");
#endif
for (;;) {
osDelay(1000);
}
}