don't include any font when building with WLED_DISABLE_2D
saves up to 12Kb program space in flash
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#undef WLED_ENABLE_FULL_FONTS
|
#undef WLED_ENABLE_FULL_FONTS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(WLED_DISABLE_2D) // don't include any font in 1D-only builds - saves up to 12Kb of flash
|
||||||
|
|
||||||
// pull in all fonts
|
// pull in all fonts
|
||||||
#include "src/font/console_font_4x6.h"
|
#include "src/font/console_font_4x6.h"
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
#include "src/font/console_font_6x8.h"
|
#include "src/font/console_font_6x8.h"
|
||||||
#include "src/font/console_font_7x9.h"
|
#include "src/font/console_font_7x9.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// fontInfo struct returned by getFontInfo
|
// fontInfo struct returned by getFontInfo
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -35,6 +37,7 @@ inline FontInfo_t getFontInfo(unsigned width, unsigned height) {
|
|||||||
|
|
||||||
unsigned pixels = width * height;
|
unsigned pixels = width * height;
|
||||||
switch (pixels) {
|
switch (pixels) {
|
||||||
|
#if !defined(WLED_DISABLE_2D) // no fonts in 1D-only builds
|
||||||
// WLED standard fonts (PROGMEM)
|
// WLED standard fonts (PROGMEM)
|
||||||
case 24: // 4x6 font
|
case 24: // 4x6 font
|
||||||
font.raw = console_font_4x6;
|
font.raw = console_font_4x6;
|
||||||
@@ -74,6 +77,7 @@ inline FontInfo_t getFontInfo(unsigned width, unsigned height) {
|
|||||||
|
|
||||||
// you can add any custom fonts here
|
// you can add any custom fonts here
|
||||||
|
|
||||||
|
#endif
|
||||||
default: // no font
|
default: // no font
|
||||||
font.raw = nullptr;
|
font.raw = nullptr;
|
||||||
font.isProgMem = false;
|
font.isProgMem = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user