河北水利局项目
This commit is contained in:
70
yw/rptime.c
Normal file
70
yw/rptime.c
Normal file
@@ -0,0 +1,70 @@
|
||||
#include "stdafx.h"
|
||||
#include "rptime.h"
|
||||
|
||||
struct rptime_struct
|
||||
{
|
||||
u8 type;
|
||||
u8 year;
|
||||
u8 month;
|
||||
u8 day;
|
||||
u8 hour;
|
||||
u8 minute;
|
||||
u8 second;
|
||||
};
|
||||
|
||||
struct rptime_struct rptime;
|
||||
|
||||
void rptime_get(u8 * val)
|
||||
{
|
||||
val[0] = rptime.type;
|
||||
val[1] = rptime.year;
|
||||
val[2] = rptime.month;
|
||||
val[3] = rptime.day;
|
||||
val[4] = rptime.hour;
|
||||
val[5] = rptime.minute;
|
||||
val[6] = rptime.second;
|
||||
}
|
||||
|
||||
void rptime_set(u8 * val)
|
||||
{
|
||||
rptime.type = val[0];
|
||||
rptime.year = val[1];
|
||||
rptime.month = val[2];
|
||||
rptime.day = val[3];
|
||||
rptime.hour = val[4];
|
||||
rptime.minute = val[5];
|
||||
rptime.second = val[6];
|
||||
}
|
||||
|
||||
u8 rp_getday()
|
||||
{
|
||||
return rptime.day;
|
||||
}
|
||||
|
||||
u8 rp_gethour()
|
||||
{
|
||||
return rptime.hour;
|
||||
}
|
||||
|
||||
u8 rp_getminute()
|
||||
{
|
||||
return rptime.minute;
|
||||
}
|
||||
|
||||
u8 rp_getsecond()
|
||||
{
|
||||
return rptime.second;
|
||||
}
|
||||
|
||||
void rptime_write()
|
||||
{
|
||||
rptime_writefile((u8*)&rptime,sizeof(rptime));
|
||||
}
|
||||
|
||||
void rptime_read()
|
||||
{
|
||||
rptime_readfile((u8*)&rptime,sizeof(rptime));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user