FluxDC/components/FluxTime/FluxTime.h

64 lines
1.4 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.

/**
* @file FluxTimer.h
* @brief 时间同步头文件
*
* 用于芯片内部时钟同步Not Used
*
* @author wang xiang en
* @date 2025-04-18
* @version 版本号
* @copyright 版权声明((C)2025, YUWELL MEDTECH Co.ltd
*/
#ifndef _FLUX_TIME_H
#define _FLUX_TIME_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* 每隔多久进行一次时间数据更新*/
#define SYSTEM_TIME_UPDATE_INTERVAL_SEC (1)
/* 选择是否进行软件定时器精度测试 */
#define SYSTEM_TIME_TEST_ENABLE (0)
/**
* @brief 时间同步函数
*
* 用于时间同步操作,无网络环境无法使用。
*
* @param[in] arg not used
*/
void time_synic_task(void *arg);
#if SYSTEM_TIME_TEST_ENABLE
/**
* @brief 软件定时器精度测试任务
*
* 验证使用FreeRTOS软件定时器可以保证气阀开启周期为 0.2s 开启0.2s后再关闭)
*
* @note cpu利用率拉升至100%同时定义执行五次周期为0.2s的定时器调度器周期为1ms
* 使用GPIO输出模拟气阀切换每次切换向SD卡中写入当前时间戳持续运行读取当前日志。
*
* @param[in] arg not used
*/
void soft_timer_task(void* arg);
#endif
/**
* @brief 时间获取API
*
* 将时间转换为字符串上交
*
* @return 时间字符串提交函数
*/
char* get_time_str(void);
#ifdef __cplusplus
}
#endif
#endif /*_FLUX_TIME_H */