uchar dti; //当前
uchar sta; //起始
uchar sto; //结束
date_time[2] = 0x12; ////当前
star_time[2] = 0x18; ////起始
stop_time[2] = 0x08; ////结束
//16进制转10进制
sta = (star_time[2]&0xf0)>>4;
sto = (stop_time[2]&0xf0)>>4;
dti = (date_time[2]&0xf0)>>4;
sta= sta*10+star_time[2]&0x0f; //执行后,sta=0x02 ?
sto= sto*10+stop_time[2]&0x0f;
dti= dti*10+date_time[2]&0x0f;
ps: keil uv3 for51, 优化默认8,模拟运行出现的现象
|