forked from len0rd/rockbox
For targets without an RTC, use the rockbox build date as the start date in the FAT driver. No more 2003-08-01 files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7478 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0172b78995
commit
b2964cad0c
3 changed files with 12 additions and 3 deletions
|
|
@ -1059,8 +1059,15 @@ static void fat_time(unsigned short* date,
|
|||
{
|
||||
if (0 == *date)
|
||||
{
|
||||
/* set to 1 August 2003 */
|
||||
*date = ((2003 - 1980) << 9) | (8 << 5) | 1;
|
||||
/* Macros to convert a 2-digit string to a decimal constant.
|
||||
(YEAR), MONTH and DAY are set by the date command, which outputs
|
||||
DAY as 00..31 and MONTH as 01..12. The leading zero would lead to
|
||||
misinterpretation as an octal constant. */
|
||||
#define S100(x) 1 ## x
|
||||
#define C2DIG2DEC(x) (S100(x)-100)
|
||||
/* set to build date */
|
||||
*date = ((YEAR - 1980) << 9) | (C2DIG2DEC(MONTH) << 5)
|
||||
| C2DIG2DEC(DAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue