中级会员
 
- 积分
- 452
- 金钱
- 452
- 注册时间
- 2014-8-11
- 在线时间
- 87 小时
|
fatfs\diskio.c
//获得时间
//User defined function to give a current time to fatfs module */
//31-25: Year(0-127 org.1980), 24-21: Month(1-12), 20-16: Day(1-31) */
//15-11: Hour(0-23), 10-5: Minute(0-59), 4-0: Second(0-29 *2) */
DWORD get_fattime (void)
{
DWORD timebuf=0;
timebuf|=((calendar.w_year-1980)<<25);
timebuf|=((calendar.w_month)<<21);
timebuf|=((calendar.w_date)<<16);
timebuf|=((calendar.hour)<<11);
timebuf|=((calendar.min)<<5);
timebuf|=((calendar.sec)<<2);
return timebuf;
}
|
|