diff FontPack/base_upperRegion.c @ 21:58007c7b5499

FIX shared SFirmwareData signature at fixed address
author JeanDo
date Mon, 01 Jan 2018 18:24:07 +0100
parents 11f56f208b92
children 1df134a2706e
line wrap: on
line diff
--- a/FontPack/base_upperRegion.c	Sat Dec 30 20:24:04 2017 +0100
+++ b/FontPack/base_upperRegion.c	Mon Jan 01 18:24:07 2018 +0100
@@ -17,7 +17,7 @@
 			 Don't forget to adjust the length of the font in the last line starting
 			 const tFont .....
 
-	[..] last char vor der großen Lücke, Stand 160217 
+	[..] last char vor der gro�en L�cke, Stand 160217
 			 image_data_FontT24_0x002b[364]
 			 __attribute__((at( START_T24_FONT + (1647 * 28) ))), START_T24_FONT  (0x08142F00 - MINUS_BANK)
 
@@ -35,95 +35,55 @@
   */
 
 /* Includes ------------------------------------------------------------------*/
-#include "stdio.h"
-#include <string.h> // for memcopy
+
+#include "FirmwareData.h"
+#include "gfx_fonts.h"
 
 #include "stm32f4xx_hal.h"
-#include "gfx_engine.h"
 
-/* HINT chsw 160114
- * using Jef Driesen dctool.exe I found out that from 150K to 230K there is only '0's!!!
- */
- 
-#define VARIABLE_UPPER_REGION
-//#define FIXED_UPPER_REGION
-
-#ifdef VARIABLE_UPPER_REGION
-//static const uint8_t image_data_HelloWorld[] __attribute__((at(0x08132000 )))  = "Hello World    ";
-
-typedef struct
+const SFirmwareData font_FirmwareData  SECTION_FIRMWARE_DATA =
 {
-	uint8_t versionFirst;
-	uint8_t versionSecond;
-	uint8_t versionNOTUSED;
-	uint8_t versionBeta;
-	uint8_t signature[4];
-	uint8_t release_year;
-	uint8_t release_month;
-	uint8_t release_day;
-	uint8_t release_sub;
-	char release_info[48];
-	char dummy[4];
-} SHelloWorldData;
+    .versionFirst   = 0,
+    .versionSecond  = 9,
+    .versionThird	= 0,
+    .versionBeta	= 0,
+
+    /* 4 bytes, including trailing 0 */
+    .signature      = "cw",
 
-static const SHelloWorldData FirmwareData __attribute__((at(0x08132000))) = {
+    .release_year   = 16,
+    .release_month  = 1,
+    .release_day    = 13,
+    .release_sub    = 0,
 
-	.versionFirst		= 0,
-	.versionSecond	= 9,
-	.versionNOTUSED	= 0,
-	.versionBeta		= 0,
+    /* max 48, including trailing 0 */
+    .release_info   ="",
 
-	/* 4 bytes with trailing 0 */
-	.signature = "cw",
-	
-	.release_year = 16,
-	.release_month = 1,
-	.release_day = 13,
-	.release_sub = 0,
-	
-	/* max 48 with trailing 0 */
-	//release_info ="12345678901234567890123456789012345678901"
-	.release_info  ="",
-	
-	/* for safety reasons and coming functions */
-	.dummy[0] = 0,
-	.dummy[1] = 0,
-	.dummy[2] = 0xF0, /* the magic byte for fonts*/
-	.dummy[3] = 0xFF
+    /* for safety reasons and coming functions */
+    .magic[0] = FIRMWARE_MAGIC_FIRST,
+    .magic[1] = FIRMWARE_MAGIC_SECOND,
+    .magic[2] = FIRMWARE_MAGIC_FONT, /* the magic byte for fonts*/
+    .magic[3] = FIRMWARE_MAGIC_END
 };
-static const uint8_t image_data_end_of_header[] __attribute__((at(0x0813217e - 5 )))  = "chsw";
-
 
-// at the moment 09. Sept. 2015, font_T144_plus is the first code starting at 0x0813217e
-#include "font_T144_plus.c"			// 0x0813217e, max. 69 kB
-#include "font_T24.c"						// 0x08142F00  max. 47 kB
-// grosse Lücke von 120 kB
-#include "image_ostc.c"					// 0x0816BAD2
-#include "font_T84.c" 					// 0x08170000
-#include "font_T54.c"						// 0x081762EE
-#include "font_T105.c"					// 0x0817bd00
-// der letzte Font ist T42, dahinter ist Platz von 0x081aa5a0 (Stand 151214) bis 0x081DFFFF
-#include "font_T42.c"						// 0x0818f9c0
-// starts at BASE_TMORE = 0x081aa5a0, defined in fontT_config.h
-#include "font_Tmore.c"					// 0x081aa5a0
-
+/* Fonts fixed in upper region */
+#include "Fonts/font_awe48.h"
+#include "Fonts/font_T24.h"
+#include "Fonts/font_T42.h"
+#include "Fonts/font_T48_plus.h"
+#include "Fonts/font_T54.h"
+#include "Fonts/font_T84.h"
+#include "Fonts/font_T105.h"
+#include "Fonts/font_T144_plus.h"
 
-// im regulären unteren Speicher
-// for checked / unchecked only at the moment
-//#include "font_awe48.c"
-//#include "battery2_complete.c"
-#endif
+/* Images fixed in upper region */
+#include "Fonts/image_battery.h"
+#include "Fonts/image_heinrichs_weikamp.h"
+#include "Fonts/image_ostc.h"
 
-// starts at 0x081E0000
-#ifdef FIXED_UPPER_REGION
-#include "font_T48_plus.c"
-#include "image_heinrichs_weikamp.c" /* with no fixed region color lookup table */
-#endif
-
-
-int main(void) //__attribute__((at(0x08000000)))
+int main(void)
 {
+    return 0;
 }
-	
 
 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/