Skip to content

Commit a03742e

Browse files
committed
examples prepared for release
1 parent 5d86e09 commit a03742e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/tcUnicodeHelper.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77

88
#pragma clang diagnostic push
99
#pragma ide diagnostic ignored "UnreachableCode"
10-
#if !defined(pgm_read_byte) && defined(__MBED__)
11-
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
12-
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
13-
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
14-
#define pgm_read_float(addr) (*(const float *)(addr))
15-
#define pgm_read_ptr(addr) (*(const void*)(addr))
16-
#define memcpy_P memcpy
17-
#endif // pgm_read_byte
1810

1911
Coord UnicodeFontHandler::textExtents(const char *text, int *baseline, bool progMem) {
2012
if(adaFont == nullptr) {

src/tcUnicodeHelper.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
#include "Utf8TextProcessor.h"
88
#include "UnicodeFontDefs.h"
99

10+
#if !defined(pgm_read_dword) && defined(__MBED__)
11+
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
12+
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
13+
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
14+
#define pgm_read_float(addr) (*(const float *)(addr))
15+
#define pgm_read_ptr(addr) (*(addr))
16+
#define memcpy_P memcpy
17+
#endif // pgm_read_byte
18+
1019
/**
1120
* @file tcUnicodeHelper.h contains a Unicode handler that can process UTF-8 data and print it onto most display types.
1221
*/
@@ -354,7 +363,7 @@ class UnicodeFontHandler {
354363
*/
355364
int getYAdvance() const {
356365
if(adaFont == nullptr) return 0;
357-
return pgm_read_byte(fontAdafruit ? &adaFont->yAdvance : &unicodeFont->yAdvance);
366+
return pgm_read_byte((fontAdafruit ? &adaFont->yAdvance : &unicodeFont->yAdvance));
358367
}
359368

360369
/**

0 commit comments

Comments
 (0)