Files
2026-04-09 10:14:20 +08:00

35 lines
984 B
C
Raw Permalink 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.
#ifndef __SYS_H
#define __SYS_H
#include "at32a423.h"
#define TASK_NUMBER 6 //任务数量
#define TASK1 0 //增加可读性
#define TASK2 1 //增加可读性
#define TASK3 2 //增加可读性
#define TASK4 3 //增加可读性
#define TASK5 4 //增加可读性
#define TASK6 5 //增加可读性
typedef struct
{
uint8_t state; //当前状态1表示正常0表示离线
uint32_t time_load; //重装载值
uint32_t time_cnt; //计数器,向下计数
}SoftWatchDogStruct;
void System_TaskInit(void);
void System_TaskUpdate(void);
void System_TaskRun(void);
void System_TaskOut(uint8_t task_number,uint32_t stop_time);
void System_TaskDisable(uint8_t task_number);
void System_TaskEnable(uint8_t task_number);
void System_SoftWatchDogInit(SoftWatchDogStruct *dog,uint32_t time_load,uint8_t default_state);
void System_SoftWatchDogFeed(SoftWatchDogStruct *dog);
void System_SoftWatchDogUpdate(SoftWatchDogStruct *dog);
uint8_t System_GetSoftWatchDogState(SoftWatchDogStruct *dog);
#endif /* __SYS_H */