diff options
-rw-r--r-- | firmware/Makefile | 3 | ||||
-rw-r--r-- | firmware/drivers/fat.c | 11 | ||||
-rwxr-xr-x | tools/configure | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/firmware/Makefile b/firmware/Makefile index 8e9fad5848..1165c26975 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -9,7 +9,8 @@ | |||
9 | 9 | ||
10 | INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers -I$(BUILDDIR) | 10 | INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers -I$(BUILDDIR) |
11 | 11 | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} | 12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(BUILDDATE) $(EXTRA_DEFINES) \ |
13 | -DMEM=${MEMORYSIZE} | ||
13 | 14 | ||
14 | # This sets up 'SRC' based on the files mentioned in SOURCES | 15 | # This sets up 'SRC' based on the files mentioned in SOURCES |
15 | include $(TOOLSDIR)/makesrc.inc | 16 | include $(TOOLSDIR)/makesrc.inc |
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index c11a9f1247..7bb2645506 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c | |||
@@ -1059,8 +1059,15 @@ static void fat_time(unsigned short* date, | |||
1059 | { | 1059 | { |
1060 | if (0 == *date) | 1060 | if (0 == *date) |
1061 | { | 1061 | { |
1062 | /* set to 1 August 2003 */ | 1062 | /* Macros to convert a 2-digit string to a decimal constant. |
1063 | *date = ((2003 - 1980) << 9) | (8 << 5) | 1; | 1063 | (YEAR), MONTH and DAY are set by the date command, which outputs |
1064 | DAY as 00..31 and MONTH as 01..12. The leading zero would lead to | ||
1065 | misinterpretation as an octal constant. */ | ||
1066 | #define S100(x) 1 ## x | ||
1067 | #define C2DIG2DEC(x) (S100(x)-100) | ||
1068 | /* set to build date */ | ||
1069 | *date = ((YEAR - 1980) << 9) | (C2DIG2DEC(MONTH) << 5) | ||
1070 | | C2DIG2DEC(DAY); | ||
1064 | } | 1071 | } |
1065 | else | 1072 | else |
1066 | { | 1073 | { |
diff --git a/tools/configure b/tools/configure index d34b7e4056..eda8166498 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -814,6 +814,7 @@ export BUILDDIR=@PWD@ | |||
814 | export LANGUAGE=@LANGUAGE@ | 814 | export LANGUAGE=@LANGUAGE@ |
815 | export MEMORYSIZE=@MEMORY@ | 815 | export MEMORYSIZE=@MEMORY@ |
816 | export VERSION=\$(shell date +%y%m%d-%H%M) | 816 | export VERSION=\$(shell date +%y%m%d-%H%M) |
817 | export BUILDDATE=\$(shell date +'-DYEAR=%Y -DMONTH=%m -DDAY=%d') | ||
817 | export MKFIRMWARE=@TOOL@ | 818 | export MKFIRMWARE=@TOOL@ |
818 | export BINARY=@OUTPUT@ | 819 | export BINARY=@OUTPUT@ |
819 | export APPEXTRA=@APPEXTRA@ | 820 | export APPEXTRA=@APPEXTRA@ |