@@ -53,41 +53,60 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
53
53
#define PROGMEM __attribute__ ((section(" .progmem.data" )))
54
54
#endif
55
55
56
- // Add header of the fonts here. Comment as many as possible to conserve FLASH memory.
57
- #include " util/font5x7.h" // Comment this line if you do not need the 5x7 font
58
- #include " util/font8x16.h" // Comment this line if you do not need the 8x16 font
59
- #include " util/fontlargenumber.h" // Comment this line if you do not need the large number font
60
- #include " util/7segment.h" // Comment this line if you do not need the 7segment font
61
- // The 31x48 font is handy, but uses a big chunk of flash memory - about 7k.
62
- // If you want to use this font, uncomment the line below:
63
- // #include "util/fontlargeletter31x48.h"
56
+ // Add header of the fonts here. Fonts that aren't included below are
57
+ // eliminated by the compiler.
58
+ #include " util/font5x7.h"
59
+ #include " util/font8x16.h"
60
+ #include " util/fontlargenumber.h"
61
+ #include " util/7segment.h"
62
+ #include " util/fontlargeletter31x48.h"
64
63
65
64
#define MAXFONTS 5 // Do not change this line
66
65
66
+ // To save flash memory, change these to zeros for the fonts you do
67
+ // not want. In particular, the 31x48 font is handy, but uses a big
68
+ // chunk of flash memory - about 7k. It is excluded by default.
69
+ #ifndef INCLUDE_FONT_5x7
70
+ #define INCLUDE_FONT_5x7 1
71
+ #endif
72
+ #ifndef INCLUDE_FONT_8x16
73
+ #define INCLUDE_FONT_8x16 1
74
+ #endif
75
+ #ifndef INCLUDE_FONT_7SEG
76
+ #define INCLUDE_FONT_7SEG 1
77
+ #endif
78
+ #ifndef INCLUDE_FONT_LARGENUMBER
79
+ #define INCLUDE_FONT_LARGENUMBER 1
80
+ #endif
81
+ #ifndef INCLUDE_FONT_LARGELETTER
82
+ #define INCLUDE_FONT_LARGELETTER 0
83
+ #endif
84
+
85
+
67
86
// Add the font name as declared in the header file. Remove as many
68
87
// as possible to conserve FLASH memory.
69
88
const unsigned char *MicroOLED::fontsPointer[] = {
70
- #ifdef FONT5X7_H
89
+ #if INCLUDE_FONT_5x7
71
90
font5x7,
72
91
#else
73
92
0x0 ,
74
93
#endif
75
- #ifdef FONT8X16_H
94
+ #if INCLUDE_FONT_8x16
76
95
font8x16,
77
96
#else
78
97
0x0 ,
79
98
#endif
80
- #ifdef FONT7SEGMENT_H
99
+ #if INCLUDE_FONT_7SEG
81
100
sevensegment,
82
101
#else
83
102
0x0 ,
84
103
#endif
85
- #ifdef FONTLARGENUMBER_H
104
+ #if INCLUDE_FONT_LARGENUMBER
86
105
fontlargenumber,
87
106
#else
88
107
0x0 ,
89
108
#endif
90
- #ifdef FONTLARGELETTER31X48_H
109
+ #if INCLUDE_FONT_LARGELETTER
91
110
fontlargeletter31x48
92
111
#else
93
112
0x0
0 commit comments