Skip to content

Commit 8a7c1c4

Browse files
author
Jim Lindblom
committed
Adding flag to disable fontlargeletter by default.
The 31x48 font uses a large amount of memory - about 7k. Uncommenting out the `#define INCLUDE_LARGE_LETTER_FONT` line, near the top of SFE_MicroOLED.cpp will enable the font.
1 parent 78b0400 commit 8a7c1c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/SFE_MicroOLED.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4141
#endif
4242
#include <SFE_MicroOLED.h>
4343

44+
// The 31x48 font is handy, but uses a big chunk of flash memory - about 7k.
45+
// If you want to use font 4 in your sketch, uncomment out the line below:
46+
//#define INCLUDE_LARGE_LETTER_FONT
47+
4448
// This fixed ugly GCC warning "only initialized variables can be placed into program memory area"
4549
#undef PROGMEM
4650
#define PROGMEM __attribute__((section(".progmem.data")))
@@ -53,15 +57,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
5357
#include "util/fontlargeletter31x48.h"
5458

5559
// Change the total fonts included
60+
#ifdef INCLUDE_LARGE_LETTER_FONT
5661
#define TOTALFONTS 5
62+
#else
63+
#define TOTALFONTS 4
64+
#endif
5765

5866
// Add the font name as declared in the header file. Remove as many as possible to conserve FLASH memory.
5967
const unsigned char *MicroOLED::fontsPointer[]={
6068
font5x7
6169
,font8x16
6270
,sevensegment
6371
,fontlargenumber
72+
#ifdef INCLUDE_LARGE_LETTER_FONT
6473
,fontlargeletter31x48
74+
#endif
6575
};
6676

6777
/** \brief MicroOLED screen buffer.

0 commit comments

Comments
 (0)