]> jspc29.x-matter.uni-frankfurt.de Git - mvd_firmware.git/commitdiff
Fixed bug and improved compile time feature: Only time of last code change is recorde...
authorMichael Wiebusch <m.wiebusch@gsi.de>
Mon, 9 Feb 2015 16:10:59 +0000 (17:10 +0100)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Mon, 9 Feb 2015 16:10:59 +0000 (17:10 +0100)
.gitignore
firmware/src/Makefile
firmware/src/main.c
firmware/src/version.c
firmware/src/version.h
firmware/src/version.sh

index 9ce83acdd40c7361b212da072fe5840b5601d1cc..6874f334f21d83a25cc736f02b4db477453ea5c3 100644 (file)
@@ -13,3 +13,4 @@
 *.info_symbol
 
 .kateproject*
+*.kate-swp
index 00c6d12ffc4517f77fc3f07e5f428257eb09a7df..a4a4fe56851b8c3696e2424fa37cdfe57c79138a 100644 (file)
@@ -11,22 +11,22 @@ OBJS+=spi2.o
 OBJS+=spi3.o
 OBJS+=dac.o
 OBJS+=misc_utils.o
-OBJS+=version.o
+OBJS+=version.o
 
 # OBJS+=keypins.o
 
 
 all: src
 
-src: app.a 
+src: version.h app.a 
 
-app.a: version $(OBJS)
-       $(AR) cr app.a $(OBJS) 
+app.a: $(OBJS) version.o
+       $(AR) cr app.a $(OBJS) version.o
 
-.PHONY: src clean 
 clean: 
-       rm -f app.a $(OBJS)
+       rm -f app.a $(OBJS) version.o
        
-.PHONY:
-version:
+version.h: $(OBJS)
        ./version.sh
+
+.PHONY: src clean
\ No newline at end of file
index 310b1389ae6c37c0deed4784ecc36727084796df..14bb7f60cb0226a8ef48f37dfb987d9e5b281dd9 100644 (file)
 
 
 
-
 extern uint16_t SPI_DMA_Buffer[];
 extern uint16_t SPI_DMA_Buffer_In[];
 extern uint16_t uC_regs[];
 
 
 
-
 // prototypes for functions that are included in main.c
 
 // void SysTick_Handler(void);
@@ -44,7 +42,6 @@ extern uint16_t uC_regs[];
 void USART1_IRQHandler(void);
 
 
-
 // MAIN ---------------------------------------------------------------------
 int main(int argc, char *argv[]) {
   
@@ -65,7 +62,6 @@ int main(int argc, char *argv[]) {
   init_SPI2();
   init_SPI3();
 
-
   init_USART1();
   init_USART3();
   
@@ -90,10 +86,8 @@ int main(int argc, char *argv[]) {
     }
     
   }
-
-       return 0;
-
-
+  
+  return 0;
 }
 
 
index 41e687e3f52138b357bf78de48c4dffb10cd1d4c..b4e97c44d78a6288ce98ca7edcc1325535731569 100644 (file)
@@ -24,4 +24,3 @@ void write_timestamp(void){
   uC_regs[0x10] = (COMPILE_HOUR<<6) | (COMPILE_MINUTE);
   
 }
-
index f3ef0b92978f79a7fadb73313cafe232d94d1877..3cb6fde324fd0514e9464fcc77f56d683c4c3318 100644 (file)
@@ -7,11 +7,15 @@
  ********************************************************
  */
 
-#define COMPILE_YEAR   14
-#define COMPILE_MONTH  06
-#define COMPILE_DAY    10
-#define COMPILE_HOUR   11
-#define COMPILE_MINUTE 42
+// Do not use these constants directly in other source files
+// than "version.c". They would not be up to date
+// (due to the makefile structure)
+
+#define COMPILE_YEAR   15
+#define COMPILE_MONTH  2
+#define COMPILE_DAY    9
+#define COMPILE_HOUR   17
+#define COMPILE_MINUTE 7
 
 void write_timestamp(void);
 
index ecde1c7eaab7ae18d193455622d6524772c46abb..b729f8fa195b7943143c904fca53f9494a41a896 100755 (executable)
@@ -14,11 +14,15 @@ cat <<EOF > version.h
  ********************************************************
  */
 
-#define COMPILE_YEAR   $(date '+%y')
-#define COMPILE_MONTH  $(date '+%m')
-#define COMPILE_DAY    $(date '+%d')
-#define COMPILE_HOUR   $(date '+%H')
-#define COMPILE_MINUTE $(date '+%M')
+// Do not use these constants directly in other source files
+// than "version.c". They would not be up to date
+// (due to the makefile structure)
+
+#define COMPILE_YEAR   $(date '+%y' | sed 's/^0\+//g')
+#define COMPILE_MONTH  $(date '+%m' | sed 's/^0\+//g')
+#define COMPILE_DAY    $(date '+%d' | sed 's/^0\+//g')
+#define COMPILE_HOUR   $(date '+%H' | sed 's/^0\+//g')
+#define COMPILE_MINUTE $(date '+%M' | sed 's/^0\+//g')
 
 void write_timestamp(void);