annotate FontPack/base_upperRegion.c @ 26:66a6a0b51493

... single step in Discovery code: trying to have an oscillator.
author jDG
date Tue, 09 Jan 2018 18:34:03 +0100
parents 97eafbcb81a9
children ea1003f63e44
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
1 /**
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
2 ******************************************************************************
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
3 * @copyright heinrichs weikamp
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
4 * @file base_upperRegion.c
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
5 * @author heinrichs/weikamp, Christian Weikamp
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
6 * @date 31-August-2015
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
7 * @version V0.0.3
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
8 * @since 03-Dez-2016
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
9 * @brief The beginning of it all. main() is part of this.
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
10 * @bug
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
11 * @warning
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
12 @verbatim
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
13 ==============================================================================
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
14 ##### New characters in fonts #####
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
15 ==============================================================================
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
16 [..] Use font_tmore.c and add line to corresponding font like font_t54c
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
17 Don't forget to adjust the length of the font in the last line starting
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
18 const tFont .....
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
19
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
20 [..] last char vor der gro�en L�cke, Stand 160217
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
21 image_data_FontT24_0x002b[364]
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
22 __attribute__((at( START_T24_FONT + (1647 * 28) ))), START_T24_FONT (0x08142F00 - MINUS_BANK)
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
23
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
24 -> frei ab 0x0814E490
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
25 geht dann weiter mit image_data_ostc_fuer_Tauchcomputer_240px
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
26 sind ca. 120 kByte frei!
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
27
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
28 @endverbatim
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
29 ******************************************************************************
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
30 * @attention
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
31 *
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
32 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
33 *
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
34 ******************************************************************************
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
35 */
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
36
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
37 /* Includes ------------------------------------------------------------------*/
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
38
24
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
39 // From Common/Inc:
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
40 #include "FirmwareData.h"
24
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
41
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
42 // From Discovery/Inc
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
43 #include "gfx_fonts.h"
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
44
24
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
45 // From AC6 support:
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
46 #include <stdio.h>
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
47
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
48 //////////////////////////////////////////////////////////////////////////////
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
49
25
97eafbcb81a9 FIX move bootloader SFirmwareData at fixed address 0x0800A000
jdg@air
parents: 24
diff changeset
50 const SFirmwareData font_FirmwareData __attribute__(( section(".font_firmware_data") )) =
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
51 {
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
52 .versionFirst = 0,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
53 .versionSecond = 9,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
54 .versionThird = 0,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
55 .versionBeta = 0,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
56
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
57 /* 4 bytes, including trailing 0 */
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
58 .signature = "cw",
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
59
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
60 .release_year = 16,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
61 .release_month = 1,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
62 .release_day = 13,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
63 .release_sub = 0,
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
64
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
65 /* max 48, including trailing 0 */
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
66 .release_info ="",
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
67
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
68 /* for safety reasons and coming functions */
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
69 .magic[0] = FIRMWARE_MAGIC_FIRST,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
70 .magic[1] = FIRMWARE_MAGIC_SECOND,
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
71 .magic[2] = FIRMWARE_MAGIC_FONT, /* the magic byte for fonts*/
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
72 .magic[3] = FIRMWARE_MAGIC_END
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
73 };
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
74
24
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
75 //////////////////////////////////////////////////////////////////////////////
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
76
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
77 /* Fonts fixed in upper region */
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
78 #include "Fonts/font_awe48.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
79 #include "Fonts/font_T24.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
80 #include "Fonts/font_T42.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
81 #include "Fonts/font_T48_plus.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
82 #include "Fonts/font_T54.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
83 #include "Fonts/font_T84.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
84 #include "Fonts/font_T105.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
85 #include "Fonts/font_T144_plus.h"
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
86
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
87 /* Images fixed in upper region */
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
88 #include "Fonts/image_battery.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
89 #include "Fonts/image_heinrichs_weikamp.h"
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
90 #include "Fonts/image_ostc.h"
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
91
24
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
92 //////////////////////////////////////////////////////////////////////////////
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
93
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
94 static int errors = 0;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
95 #define ASSERT(e) \
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
96 do { if( ! (e) ) {++errors; printf("FAIL at %3d: %s", __LINE__, #e);}} while(0)
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
97
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
98 #define ASSERT_RANGE(e, min, max) \
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
99 ASSERT(min <= e); ASSERT( e <= max)
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
100
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
101 int main(void)
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
102 {
24
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
103 //---- Check the linker puts the directory at the requested address ------
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
104 ASSERT( & Awe48 == (tFont*)0x8100000 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
105 ASSERT( & FontT24 == (tFont*)0x810000c );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
106 ASSERT( & FontT42 == (tFont*)0x8100018 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
107 ASSERT( & FontT48 == (tFont*)0x8100024 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
108 ASSERT( & FontT54 == (tFont*)0x8100030 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
109 ASSERT( & FontT84 == (tFont*)0x810003c );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
110 ASSERT( & FontT105 == (tFont*)0x8100048 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
111 ASSERT( & FontT144 == (tFont*)0x8100052 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
112
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
113 //---- Check the linker puts the font data in the requested section ------
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
114 extern tChar __upper_font_data;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
115 extern tChar __upper_font_data_end;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
116 ASSERT( &__upper_font_data == (tChar*)0x08132040 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
117 ASSERT_RANGE( (int)&__upper_font_data_end, 0x08132040, 0x081E0000);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
118
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
119 //---- Walk through the directory data -----------------------------------
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
120 extern const tFont __font_directory;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
121 extern const tFont __font_directory_end;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
122 for(const tFont* font = & __font_directory; font < &__font_directory_end; ++font)
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
123 {
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
124 // Check END-OF-DIRECTORY magic marker
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
125 if( font->length == (uint32_t)-1 )
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
126 {
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
127 ASSERT( font == &FontT144 + 1 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
128 break;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
129 }
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
130
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
131 // Check font descriptors are inside a safe range.
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
132 ASSERT_RANGE( font->length, 10, 103 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
133 ASSERT_RANGE( font->spacesize, 0, 18 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
134 ASSERT_RANGE( font->spacesize2Monospaced, 13, 72 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
135 ASSERT_RANGE( font->height, 28, 108 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
136
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
137 //---- Walk through each char ----------------------------------------
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
138 for(int i = 0; i < font->length; ++i)
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
139 {
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
140 const tChar* c = &font->chars[i];
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
141
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
142 // Check char data is indeed stored in the actual data section
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
143 ASSERT_RANGE( c, &__upper_font_data, &__upper_font_data_end);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
144
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
145 // Check char data sanity
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
146 ASSERT_RANGE( c->code, 0x0000, 0xF143);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
147
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
148 // Check image sanity
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
149 const tImage* image = c->image;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
150 ASSERT_RANGE(image, (tImage*)&__upper_font_data, (tImage*)&__upper_font_data_end);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
151 ASSERT_RANGE(image->width, font->spacesize, font->spacesize2Monospaced);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
152 ASSERT(image->height == font->height);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
153
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
154 // Uncompress image bytes
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
155 const uint8_t* byte = image->data;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
156 ASSERT_RANGE(byte, (uint8_t*)&__upper_font_data, (uint8_t*)&__upper_font_data_end);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
157
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
158 for(int w=0; w <image->width; ++w)
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
159 {
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
160 // Compression: special 0x01 byte at start of column means just skip it.
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
161 if( *byte++ == 0x01 )
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
162 continue;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
163
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
164 int zeros = (byte[-1] == 0x00) ? 1 : 0;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
165 for(int h = 1; h < image->height; ++h)
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
166 {
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
167 if( *byte == 0x00 )
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
168 ++zeros;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
169
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
170 // Other bytes cannot have the 0x01 value...
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
171 ASSERT( *byte++ != 0x01 );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
172 }
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
173
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
174 if( zeros == image->height )
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
175 printf("Font[%d] char[%d]: could skip column %d",
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
176 &__font_directory - font, i, w);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
177 }
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
178
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
179 // Check the byte stream do not collide with the next char,
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
180 // or with the first tImage struct of the font.
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
181 if( (i+1) < font->length )
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
182 ASSERT( byte < font->chars[i+1].image->data );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
183 else
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
184 ASSERT( byte < (uint8_t*)font->chars[0].image );
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
185
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
186 // TODO: check image bytes are contiguous between chars.
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
187 }
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
188 }
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
189
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
190 if( errors )
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
191 {
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
192 printf("Font Check: %d errors.", errors);
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
193 return -1;
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
194 }
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
195
4de447ee5d1b ADD font check code that runs at FontPack installation.
JeanDo
parents: 22
diff changeset
196 printf("Font Check: no errors.");
21
58007c7b5499 FIX shared SFirmwareData signature at fixed address
JeanDo
parents: 16
diff changeset
197 return 0;
16
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
198 }
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
199
11f56f208b92 ... FontPack CPU1 project
jdg@air
parents:
diff changeset
200 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/