#include "mydef.h"
#include "at89x51.h"
#include "absacc.h"
#include "stc12c5a.h"
#include "ds12c887.h"
main()
{
unchar i,j ,k;
i=80;
while(--i)
{
j=80;
while(--j)
{
k=30;
while(--k);
}
}
movxfast(); //外部数据总线速率设置为最快
opitr(); //中断允许
inituart(); //初始化串口
inititr0(); //初始化外部中断0
uarton(); //启动串口
initds887(); //初始化ds887
while(1)
{
if(datanum>=6)
{
theyear=readbuf();
themonth=readbuf();
theday=readbuf();
thehour=readbuf();
theminute=readbuf();
thesecond=readbuf();
setday(); //设置日期
settime(); //设置时间
getday(); //获取日期
}
if(updateflag)
{
updateflag=0;
getday(); //获取日期
gettime(); //获取时间
senddata(theyear);
senddata(themonth);
senddata(theday);
senddata(thehour);
senddata(theminute);
senddata(thesecond);
senddata(secondcount);
}
}
}
评论8
最新资源