Rev 19 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 19 | Rev 24 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | 21 | ||
22 | #include "Font.h" |
22 | #include "Font.h" |
23 | /* |
23 | /* |
24 | * display text using a 5x7 bitmap font in ASCII letters |
24 | * display text using a 5x7 bitmap font in ASCII letters |
25 | */ |
25 | */ |
26 | static unsigned char font [] [5] = { |
26 | static const unsigned char font [] [5] = { |
27 | { 0x00,0x00,0x00,0x00,0x00 }, // 0x20 32 |
27 | { 0x00,0x00,0x00,0x00,0x00 }, // 0x20 32 |
28 | { 0x00,0x00,0x6f,0x00,0x00 }, // ! 0x21 33 |
28 | { 0x00,0x00,0x6f,0x00,0x00 }, // ! 0x21 33 |
29 | { 0x00,0x07,0x00,0x07,0x00 }, // " 0x22 34 |
29 | { 0x00,0x07,0x00,0x07,0x00 }, // " 0x22 34 |
30 | { 0x14,0x7f,0x14,0x7f,0x14 }, // # 0x23 35 |
30 | { 0x14,0x7f,0x14,0x7f,0x14 }, // # 0x23 35 |
31 | // { 0x00,0x07,0x04,0x1e,0x00 }, // $ 0x24 36 |
31 | // { 0x00,0x07,0x04,0x1e,0x00 }, // $ 0x24 36 |
Line 122... | Line 122... | ||
122 | { 0x00,0x08,0x36,0x41,0x41 }, // { 0x7b 123 |
122 | { 0x00,0x08,0x36,0x41,0x41 }, // { 0x7b 123 |
123 | { 0x00,0x00,0x7f,0x00,0x00 }, // | 0x7c 124 |
123 | { 0x00,0x00,0x7f,0x00,0x00 }, // | 0x7c 124 |
124 | { 0x41,0x41,0x36,0x08,0x00 }, // } 0x7d 125 |
124 | { 0x41,0x41,0x36,0x08,0x00 }, // } 0x7d 125 |
125 | // { 0x04,0x02,0x04,0x08,0x04 }, // ~ 0x7e 126 |
125 | // { 0x04,0x02,0x04,0x08,0x04 }, // ~ 0x7e 126 |
126 | { 0x08,0x0c,0x08,0x18,0x08 }, |
126 | { 0x08,0x0c,0x08,0x18,0x08 }, |
- | 127 | ||
- | 128 | ||
- | 129 | ||
127 | }; |
130 | }; |
128 | 131 | ||
- | 132 | #define extDegrees 0 |
|
129 | 133 | ||
- | 134 | static const unsigned char font_ext[] [5] = |
|
- | 135 | { |
|
- | 136 | ||
- | 137 | [extDegrees] = { 0x00,0x06,0x09,0x06,0x00 }, // a ° sign |
|
- | 138 | ||
- | 139 | }; |
|
130 | 140 | ||
131 | 141 | ||
132 | 142 | ||
133 | 143 | ||
134 | void font_gotoxy(uint8_t x,uint8_t y) |
144 | void font_gotoxy(uint8_t x,uint8_t y) |
Line 157... | Line 167... | ||
157 | { |
167 | { |
158 | if(c>' ' && c<0x80) |
168 | if(c>' ' && c<0x80) |
159 | { |
169 | { |
160 | *ptr++ = font[c-' '][i]; |
170 | *ptr++ = font[c-' '][i]; |
161 | } |
171 | } |
- | 172 | else if(c=='°') |
|
- | 173 | { |
|
- | 174 | *ptr++ = font_ext[extDegrees][i]; |
|
- | 175 | } |
|
162 | else |
176 | else |
163 | { |
177 | { |
164 | *ptr++ = 0; |
178 | *ptr++ = 0; |
165 | } |
179 | } |
166 | } |
180 | } |
167 | *ptr++=0; |
181 | *ptr++=0; |
168 | 182 | ||
169 | // move cursor |
183 | // move cursor |