Release:5.20灰测

This commit is contained in:
2026-05-21 10:01:28 +08:00
parent 8a5a32b139
commit fd65e9c6a2
68 changed files with 4329 additions and 1489 deletions

22
Core/User/App/task_sys.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef __TASK_SYS_H
#define __TASK_SYS_H
/* includes ----------------------------------------------------------------------------------------------*/
#include "global.h"
#include "cmsis_os.h" // 或使用 HAL_GetTick() 等
// 获取当前系统时间(毫秒)
//#define GET_TICK() (osKernelSysTick()) // FreeRTOS/CMSIS-RTOS
#define GET_TICK() (HAL_GetTick()) // STM32 HAL 用户可换这行
// 非阻塞延时宏:每 interval_ms 执行一次 {code}
#define RUN_EVERY(interval_ms, static_tick_var, code) \
do { \
static uint32_t static_tick_var = 0; \
if ((GET_TICK() - static_tick_var) >= (interval_ms)) { \
static_tick_var = GET_TICK(); \
code; \
} \
} while(0)
#endif /* __TASK_SYS_H */