大学生
最后登录1970-1-1
在线时间 小时
注册时间2015-8-12
|
发表于 2015-9-22 16:56:51
|
显示全部楼层
看了下那程序
void Time_Display(uint32_t TimeVar,struct rtc_time *tm)
{
static uint32_t FirstDisplay = 1;
uint32_t BJ_TimeVar;
uint8_t str[15]; // ×·
/* °±ê×±×±±±*/
BJ_TimeVar =TimeVar + 8*60*60;
to_tm(BJ_TimeVar, tm);/*°¨±÷×±±±*/
if((!tm->tm_hour && !tm->tm_min && !tm->tm_sec) || (FirstDisplay))
{
GetChinaCalendar((u16)tm->tm_year, (u8)tm->tm_mon, (u8)tm->tm_mday, str);
printf("\r\n ìú─ .2d%0.2d,%0.2d,%0.2d", str[0], str[1], str[2], str[3]);
GetChinaCalendarStr((u16)tm->tm_year,(u8)tm->tm_mon,(u8)tm->tm_mday,str);
printf("\r\n ìú─猀尀爀尀渀", str);
if(GetJieQiStr((u16)tm->tm_year, (u8)tm->tm_mon, (u8)tm->tm_mday, str))
printf("\r\n ìú─猀尀爀尀渀", str);
FirstDisplay = 0;
}
/* ±ú± */
printf(" UNIX± = %d ±°±: %dê(%sê) %d %d (─猀) %0.2d:%0.2d:%0.2d\r",TimeVar,
tm->tm_year, zodiac_sign[(tm->tm_year-3)%12], tm->tm_mon, tm->tm_mday,
WEEK_STR[tm->tm_wday], tm->tm_hour,
tm->tm_min, tm->tm_sec);
}
都是字符串,直接用TFT里面的display程序就行,都不用转了。 |
|