Bootload from SD card to sector 0, and jump to sector 24 where new firmware resides

Dependencies:   FatFS mbed

Fork of Panel-Controller-Bootloader by Emma

Revision:
0:c3a652eff606
diff -r 000000000000 -r c3a652eff606 fattime.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fattime.c	Tue Apr 21 09:30:11 2015 +0000
@@ -0,0 +1,23 @@
+/* Martin Thomas 4/2009 */
+
+#include "integer.h"
+#include "fattime.h"
+#include "rtc.h"
+
+DWORD get_fattime (void)
+{
+	DWORD res;
+	RTC_t rtc;
+
+	rtc_gettime( &rtc );
+	
+	res =  (((DWORD)rtc.year - 1980) << 25)
+			| ((DWORD)rtc.month << 21)
+			| ((DWORD)rtc.mday << 16)
+			| (WORD)(rtc.hour << 11)
+			| (WORD)(rtc.min << 5)
+			| (WORD)(rtc.sec >> 1);
+
+	return res;
+}
+