#include "app.h" #include "board.h" #include "flow.h" static struct flow idle_fw; // 空闲任务 /** * @brief 对流量进行空闲检查 * * 该函数会对传入的流量结构体进行空闲检查。 * * @param fl 指向流量结构体的指针 * * @return 返回值始终为0,该函数不返回实际值 */ static uint8_t idle_inspection(struct flow *fl) { FL_HEAD(fl); for (;;) { GPIO_TOGGLE(LED_BLUE_GPIO_Port, LED_BLUE_Pin); FL_LOCK_DELAY(fl, FL_CLOCK_SEC * 1); } FL_TAIL(fl); } /** * @brief 运行应用程序 * * 该函数用于启动应用程序的运行。 * * @details 此函数会调用 idle_inspection 函数,传入 idle_fw 作为参数。 * idle_inspection 函数的具体作用需参考其实现细节。 */ void app_run(void) { idle_inspection(&idle_fw); } /** * @brief 初始化应用程序 * * 初始化应用程序,包括启动空闲任务。 */ void app_init(void) { FL_INIT(&idle_fw); // 空闲任务 ENABLE_TIM(TASK_TIM); }