Skip to content

Commit

Permalink
examples prepared for release
Browse files Browse the repository at this point in the history
  • Loading branch information
davetcc committed Dec 17, 2022
1 parent 5d86e09 commit a03742e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/tcUnicodeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

#pragma clang diagnostic push
#pragma ide diagnostic ignored "UnreachableCode"
#if !defined(pgm_read_byte) && defined(__MBED__)
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
#define pgm_read_float(addr) (*(const float *)(addr))
#define pgm_read_ptr(addr) (*(const void*)(addr))
#define memcpy_P memcpy
#endif // pgm_read_byte

Coord UnicodeFontHandler::textExtents(const char *text, int *baseline, bool progMem) {
if(adaFont == nullptr) {
Expand Down
11 changes: 10 additions & 1 deletion src/tcUnicodeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
#include "Utf8TextProcessor.h"
#include "UnicodeFontDefs.h"

#if !defined(pgm_read_dword) && defined(__MBED__)
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
#define pgm_read_float(addr) (*(const float *)(addr))
#define pgm_read_ptr(addr) (*(addr))
#define memcpy_P memcpy
#endif // pgm_read_byte

/**
* @file tcUnicodeHelper.h contains a Unicode handler that can process UTF-8 data and print it onto most display types.
*/
Expand Down Expand Up @@ -354,7 +363,7 @@ class UnicodeFontHandler {
*/
int getYAdvance() const {
if(adaFont == nullptr) return 0;
return pgm_read_byte(fontAdafruit ? &adaFont->yAdvance : &unicodeFont->yAdvance);
return pgm_read_byte((fontAdafruit ? &adaFont->yAdvance : &unicodeFont->yAdvance));
}

/**
Expand Down

0 comments on commit a03742e

Please sign in to comment.