Files
HBshuiwuConcentrator/dl/dlarrivetime.c
2025-12-15 16:07:49 +08:00

46 lines
632 B
C

#include "include.h"
#include "rtc_ext.h"
/*
抄表过程
*/
extern u32 time_cur;
static bool is_dltimearrive = false;
static u32 dltime_cur = 0;
void dl_set()
{
is_dltimearrive = true;
}
bool is_dl_time()
{
st_rtc_ext * time_dat = NULL;
time_dat = (st_rtc_ext *)GetCurrentTime();
if(time_dat->hour == 0x01 && time_dat->min == 0x01 && is_dltimearrive == false)
{
is_dltimearrive = true;
dltime_cur = time_cur;
}
if(is_dltimearrive)
{
if(time_cur-dltime_cur > 2*60)
{
printf("\r\n**************** 一点时间到 启动抄表开始 ********\r\n");
is_dltimearrive = false;
return true;
}
}
return false;
}