2026-07-17 09:08:53 +08:00
|
|
|
|
#ifndef __CLOCK_H__
|
|
|
|
|
|
#define __CLOCK_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
|
|
// 全局软时钟变量声明
|
|
|
|
|
|
extern u8 current_hour;
|
|
|
|
|
|
extern u8 current_min;
|
|
|
|
|
|
extern u8 current_sec;
|
|
|
|
|
|
extern volatile u8 clock_updated;
|
2026-07-31 18:49:03 +08:00
|
|
|
|
extern volatile bit second_tick_flag; // 整秒滴答标志位,每次 current_sec 递增时置 1,供主循环转换为事件
|
2026-07-17 09:08:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 系统软时钟毫秒递增更新 (在 1ms 中断中调用)
|
|
|
|
|
|
*/
|
|
|
|
|
|
void Clock_IncMS(void);
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __CLOCK_H__
|