构建测试

This commit is contained in:
2026-08-22 19:53:24 +08:00
parent a7f367f6a3
commit fc88bc8752
15 changed files with 2050 additions and 1578 deletions

View File

@@ -34,6 +34,7 @@
#include "ff.h"
#include "gd5f2gq5ue.h"
#include "lftpd.h"
#include "../test/ch395f_test_task.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -100,6 +101,13 @@ const osThreadAttr_t ftpTask_attributes = {
.stack_size = 1024 * 4,
.priority = (osPriority_t) osPriorityNormal,
};
/* Definitions for ch395fTestTask */
osThreadId_t ch395fTestTaskHandle;
const osThreadAttr_t ch395fTestTask_attributes = {
.name = "ch395fTestTask",
.stack_size = 4096 * 4,
.priority = (osPriority_t) osPriorityBelowNormal,
};
/* Definitions for netMsgQueue */
osMessageQueueId_t netMsgQueueHandle;
const osMessageQueueAttr_t netMsgQueue_attributes = {
@@ -114,6 +122,7 @@ const osMessageQueueAttr_t netMsgQueue_attributes = {
void StartDefaultTask(void *argument);
void StartNetTask(void *argument);
void StartFtpTask(void *argument);
void StartCh395fTestTask(void *argument);
void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */
@@ -155,7 +164,10 @@ void MX_FREERTOS_Init(void) {
netTaskHandle = osThreadNew(StartNetTask, NULL, &netTask_attributes);
/* creation of ftpTask */
ftpTaskHandle = osThreadNew(StartFtpTask, NULL, &ftpTask_attributes);
//ftpTaskHandle = osThreadNew(StartFtpTask, NULL, &ftpTask_attributes);
/* creation of ch395fTestTask */
ch395fTestTaskHandle = osThreadNew(StartCh395fTestTask, NULL, &ch395fTestTask_attributes);
/* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
@@ -307,6 +319,24 @@ __weak void StartFtpTask(void *argument)
/* USER CODE END StartFtpTask */
}
/* USER CODE BEGIN Header_StartCh395fTestTask */
/**
* @brief Function implementing the ch395fTestTask thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartCh395fTestTask */
__weak void StartCh395fTestTask(void *argument)
{
/* USER CODE BEGIN StartCh395fTestTask */
/* Infinite loop */
for(;;)
{
osDelay(1);
}
/* USER CODE END StartCh395fTestTask */
}
/* Private application code --------------------------------------------------*/
/* USER CODE BEGIN Application */

View File

@@ -36,7 +36,6 @@
#include "rs485.h"
#include "net_socket.h"
#include "net_select.h"
#include "ch395f_test.h"
#include "app_main.h"
#include "sys_clock.h"
/* USER CODE END Includes */
@@ -182,22 +181,7 @@ int main(void)
/* 启动第一次转换CubeMX 已配置 BUSY EXTI 中断) */
tpafe5160_start_conv_irq();
/* CH395F 驱动测试 — 各阶段独立运行,注释 define 可跳过 */
#ifdef ENABLE_PHASE1_TESTS
ch395f_phase1_tests();
#endif
#ifdef ENABLE_PHASE3_TESTS
ch395f_phase3_tests();
#endif
#ifdef ENABLE_PHASE2_TESTS
ch395f_phase2_tests();
#endif
#ifdef ENABLE_PHASE5_TESTS
ch395f_phase5_init();
#endif
#ifdef ENABLE_PHASE6_TESTS
ch395f_phase6_tests();
#endif
/* CH395F 测试已全部移至 ch395fTestTask */
/* USER CODE END 2 */
/* Init scheduler */