河北水利局项目
This commit is contained in:
44
yw/concenttime.c
Normal file
44
yw/concenttime.c
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "stdafx.h"
|
||||
#include "concenttime.h"
|
||||
#include "rtc_ext.h"
|
||||
|
||||
/*
|
||||
设置集中器时间
|
||||
*/
|
||||
|
||||
//static u8 concenttime[6];
|
||||
|
||||
|
||||
void concenttime_get(u8 * timeval)
|
||||
{
|
||||
// r8025t_get_time(&time_tt);
|
||||
st_rtc_ext rtc_dat = {0x00};
|
||||
|
||||
read_rtc_time(&rtc_dat);
|
||||
|
||||
timeval[0] = rtc_dat.sec;
|
||||
timeval[1] = rtc_dat.min;
|
||||
timeval[2] = rtc_dat.hour;
|
||||
timeval[3] = rtc_dat.day;
|
||||
timeval[4] = rtc_dat.month;
|
||||
timeval[5] = rtc_dat.year;
|
||||
timeval[6] = 0x21;
|
||||
|
||||
}
|
||||
|
||||
void concenttime_set(u8 * time)
|
||||
{
|
||||
//秒分时日月年
|
||||
st_rtc_ext rtc_dat = {0x00};
|
||||
|
||||
rtc_dat.sec = time[0];;
|
||||
rtc_dat.min = time[1];
|
||||
rtc_dat.hour = time[2];
|
||||
rtc_dat.day = time[3];
|
||||
rtc_dat.month = time[4];
|
||||
rtc_dat.year = (0x20<<8)|time[5];
|
||||
rtc_dat.week = 1;
|
||||
set_rtc_time(rtc_dat);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user