# HG changeset patch # User Ideenmodellierer # Date 1548622867 -3600 # Node ID a984d87a1ec02c0cb6afb3e25ee3849afea82ddf # Parent 871baf20776b5bb455a03f6fe35a108f2b5ce9f4 Added option to build FontPack as static libary which is linked to the Firmware project (to allow separate build settings) diff -r 871baf20776b -r a984d87a1ec0 Common/CPU1-F429.ld --- a/Common/CPU1-F429.ld Sun Jan 13 18:59:53 2019 +0100 +++ b/Common/CPU1-F429.ld Sun Jan 27 22:01:07 2019 +0100 @@ -124,7 +124,6 @@ *(.glue_7) /* glue arm to thumb code */ *(.glue_7t) /* glue thumb to arm code */ *(.eh_frame) - . = ALIGN(4); _etext = .; /* define a global symbols at end of code */ } >ROM @@ -195,54 +194,9 @@ KEEP( *(.bootloader_firmware_data) ) } > ROM - - .upper_font_dir 0x081DEF00 : { /* Flash Sector 23 is protected (bootloader font + image) => use end of sector 22 */ - /* Define Known Address for Each Font */ - __font_directory = .; - - - *(.upper_font_directory.Awe48) - *(.upper_font_directory.FontT24) - *(.upper_font_directory.FontT42) - *(.upper_font_directory.FontT48) - *(.upper_font_directory.FontT54) - *(.upper_font_directory.FontT84) - *(.upper_font_directory.FontT105) - *(.upper_font_directory.FontT144) - *(.upper_font_directory.Batt24*) + /* Flash Sector 23 is protected (bootloader font + image) => use end of sector 22 */ - __font_directory_end = .; - LONG( -1 ); /* Magic End Marker */ - - /* and for Each Image */ -/* __image_directory = .; */ -/* PROVIDE( ImgHWcolor = __image_directory + 0 * 8 ); - PROVIDE( ImgOSTC = __image_directory + 1 * 8 ); */ -/* __image_directory_end = __image_directory + 2 * 8; */ - -/* KEEP( *(.upper_image_directory) ) */ - - /* FIXME: shall KEEP images here */ - LONG( -1 ); /* Magic End Marker */ - - /* and for CLUT */ -/* PROVIDE( indexHWcolor = . ); */ - . += 0x100; - LONG( -1 ); /* Magic End Marker */ - } >UPPER - - - - - /* Put fonts and images in UPPER region */ - /* - .upper_images : { - __upper_image_data = .; - KEEP( *(.newupper_images) ) - __upper_image_data_end = .; - } > UPPER - */ /* TODO: the linker does not seem to work as the one of used for initial bootloader ==> Reconstruct layout to keep it compatible with the first version */ @@ -516,14 +470,30 @@ /* moving of fonts from lower to upper */ - *(.upper_fonts*) + *(.upper_fonts.*) __upper_font_data_end = .; } >UPPER - + .upper_directory 0x081DEF00 : { + __font_directory = .; + *(.upper_font_directory.Awe48) + *(.upper_font_directory.FontT24) + *(.upper_font_directory.FontT42) + *(.upper_font_directory.FontT48) + *(.upper_font_directory.FontT54) + *(.upper_font_directory.FontT84) + *(.upper_font_directory.FontT105) + *(.upper_font_directory.FontT144) + *(.upper_font_directory.Batt24*) + + __font_directory_end = .; + LONG( -1 ); /* Magic End Marker */ + + } >UPPER + @@ -570,6 +540,7 @@ . = ALIGN(8); PROVIDE ( end = . ); PROVIDE ( _end = . ); + PROVIDE ( __end__ = . ); . = . + _Min_Heap_Size; . = . + _Min_Stack_Size; . = ALIGN(8); diff -r 871baf20776b -r a984d87a1ec0 Discovery/Src/gfx_fonts.c --- a/Discovery/Src/gfx_fonts.c Sun Jan 13 18:59:53 2019 +0100 +++ b/Discovery/Src/gfx_fonts.c Sun Jan 27 22:01:07 2019 +0100 @@ -22,10 +22,6 @@ # define INCLUDE_FONTS_BINARY #endif -#ifndef INCLUDE_FONTS_BINARY -#define INCLUDE_FONTS_BINARY 1 -#endif - #ifdef INCLUDE_FONTS_BINARY /* Fonts fixed in upper region */ diff -r 871baf20776b -r a984d87a1ec0 FontPack/base_upperRegion.c --- a/FontPack/base_upperRegion.c Sun Jan 13 18:59:53 2019 +0100 +++ b/FontPack/base_upperRegion.c Sun Jan 27 22:01:07 2019 +0100 @@ -49,12 +49,12 @@ // From Common/Inc: #include "FirmwareData.h" -// From Discovery/Inc -#include "gfx_fonts.h" +#ifdef DEBUG // From AC6 support: #include #include +#endif ////////////////////////////////////////////////////////////////////////////// @@ -85,6 +85,7 @@ ////////////////////////////////////////////////////////////////////////////// +#ifdef BUILD_LIBRARY /* Fonts fixed in upper region */ #include "Fonts/font_awe48.h" #include "Fonts/font_T24.h" @@ -95,32 +96,35 @@ #include "Fonts/font_T105.h" #include "Fonts/font_T144_plus.h" +#include "Fonts/image_ostc.h" +#else +#include "gfx_fonts.h" +#endif /* Images fixed in upper region */ #include "Fonts/image_battery.h" #include "Fonts/image_heinrichs_weikamp.h" -#include "Fonts/image_ostc.h" + +///////////////////////////////////////////////////////////////////////////// + -////////////////////////////////////////////////////////////////////////////// +#ifdef DEBUG + +#define ASSERT(e) \ + do { if( ! (e) ) { ++errors; printf("FAIL at %3d: %s \n", __LINE__, #e); errorflag = 1;} } while(0) + +#define ASSERT_RANGE(e, min, max) ASSERT(min <= e); ASSERT( e <= max) extern void initialise_monitor_handles(void); static int errors = 0; static uint8_t errorflag = 0; -#define ASSERT(e) \ - do { if( ! (e) ) { ++errors; printf("FAIL at %3d: %s \n", __LINE__, #e); errorflag = 1;} } while(0) - -#define ASSERT_RANGE(e, min, max) ASSERT(min <= e); ASSERT( e <= max) - - - int main(void) { -#ifdef DEBUG_STLINK_V2 +#if DEBUG_STLINK_V2 initialise_monitor_handles(); #endif - //---- Check the linker puts the directory at the requested address ------ ASSERT( & Awe48 == (tFont*)0x81DFE00 ); ASSERT( & FontT24 == (tFont*)0x81DFE0c ); @@ -131,8 +135,6 @@ ASSERT( & FontT105 == (tFont*)0x81DFE48 ); ASSERT( & FontT144 == (tFont*)0x81DFE54 ); - - //---- Check the linker puts the font data in the requested section ------ extern tChar __upper_font_data; extern tChar __upper_font_data_end; @@ -145,9 +147,6 @@ ASSERT_RANGE(&ImgOSTC, (tImage*)&__upper_font_data, (tImage*)&__upper_font_data_end); - - - for(const tFont* font = & __font_directory; font < &__font_directory_end; ++font) { printf("Font: %x\n",font); @@ -236,5 +235,28 @@ printf("Font Check: no errors.\n"); return 0; } +/*#endif*/ +#else +#define ASSERT(e) \ + do { if( ! (e) ) { ++errors; errorflag = 1;} } while(0) +#define ASSERT_RANGE(e, min, max) ASSERT(min <= e); ASSERT( e <= max) + +uint16_t errors = 1; +static uint8_t errorflag = 0; +uint16_t CheckFontPosition() +{ + uint16_t retvalue; + ASSERT( & Awe48 == (tFont*)0x81DFE00 ); + ASSERT( & FontT24 == (tFont*)0x81DFE0c ); + ASSERT( & FontT42 == (tFont*)0x81DFE18 ); + ASSERT( & FontT48 == (tFont*)0x81DFE24 ); + ASSERT( & FontT54 == (tFont*)0x81DFE30 ); + ASSERT( & FontT84 == (tFont*)0x81DFE3c ); + ASSERT( & FontT105 == (tFont*)0x81DFE48 ); + ASSERT( & FontT144 == (tFont*)0x81DFE54 ); + retvalue = errors; + return retvalue; +} +#endif /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/ diff -r 871baf20776b -r a984d87a1ec0 RefPrj/Firmware/.cproject --- a/RefPrj/Firmware/.cproject Sun Jan 13 18:59:53 2019 +0100 +++ b/RefPrj/Firmware/.cproject Sun Jan 27 22:01:07 2019 +0100 @@ -50,7 +50,12 @@ - + + - - + +