本帖最后由 看见未来 于 2012-10-13 22:20 编辑
这是在.h文件里定义的部分:
typedef struct
{
uint_8 year;
uint_8 month;
uint_8 week;
uint_8 day;
uint_8 hour;
uint_8 minute;
uint_8 second;
}TIME;
extern TIME current_time;
这是在程序里读取时间的部分:
current_time.second = BcdToDec(ds1302_read_time(ds1302_read_addr[0]));
current_time.minute = BcdToDec(ds1302_read_time(ds1302_read_addr[1]));
current_time.hour = BcdToDec(ds1302_read_time(ds1302_read_addr[2]));
current_time.day = BcdToDec(ds1302_read_time(ds1302_read_addr[3]));
current_time.month = BcdToDec(ds1302_read_time(ds1302_read_addr[4]));
current_time.week = BcdToDec(ds1302_read_time(ds1302_read_addr[5]));
current_time.year = BcdToDec(ds1302_read_time(ds1302_read_addr[6]));
编译出现问题,如图提示,怎么回事啊? |