Skip to content

Commit a4a635b

Browse files
committed
#17 fix for esp32 idf support
1 parent 7fc3c7a commit a4a635b

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎library.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ category=Other
1111
url=https://github.com/TcMenu/tcUnicodeHelper
1212
sentence=Adds tcUnicode UTF-8 support to Adafruit_GFX, U8G2, tcMenu, and TFT_eSPI graphics libraries with a graphical font creation utility available. Works with existing libraries
1313
paragraph=Adds tcUnicode UTF-8 support to Adafruit_GFX, U8G2, tcMenu, and TFT_eSPI graphics libraries with a graphical font creation utility available. Works with existing libraries
14+
depends=TcMenuLog

‎src/tcUnicodeHelper.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#define TCUNICODE_API_VERSION 2
1515

16-
#if !defined(pgm_read_dword) && (defined(__MBED__) || defined(BUILD_FOR_PICO_CMAKE) || defined(BUILD_FOR_STM32CUBE_CMAKE) || defined(BUILD_FOR_NATIVE_PLATFORM))
16+
#if !defined(pgm_read_dword) && (defined(__MBED__) || defined(BUILD_FOR_PICO_CMAKE) || defined(BUILD_FOR_STM32CUBE_CMAKE) || defined(BUILD_FOR_NATIVE_PLATFORM) || defined(BUILD_FOR_ESP32_IDF))
1717
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
1818
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
1919
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
@@ -132,14 +132,14 @@ class GlyphWithBitmap {
132132

133133
void handleUtf8Drawing(void *userData, uint32_t ch);
134134

135-
#if __has_include (<Print.h>) || defined(ARDUINO_SAM_DUE)
135+
#if (__has_include (<Print.h>) || defined(ARDUINO_SAM_DUE)) && !defined(BUILD_FOR_ESP32_IDF)
136136
#include <Print.h>
137137
class UnicodeFontHandler : public Print {
138138
#elif __has_include(<PrintCompat.h>)
139139
#include <PrintCompat.h>
140140
class UnicodeFontHandler : public Print {
141141
#else
142-
class UnicodeFontHandler {
142+
#error "Either Print.h or PrintCompat.h must be included, cannot build."
143143
#endif
144144

145145
public:
@@ -252,7 +252,7 @@ class UnicodeFontHandler {
252252
*/
253253
Coord textExtents_P(const char *text, int *baseline) { return textExtents(text, baseline, true); }
254254

255-
#if !defined(__MBED__) && !defined(BUILD_FOR_PICO_CMAKE) && !defined(BUILD_FOR_STM32CUBE_CMAKE) && !defined(BUILD_FOR_NATIVE_PLATFORM)
255+
#if !defined(__MBED__) && !defined(BUILD_FOR_PICO_CMAKE) && !defined(BUILD_FOR_STM32CUBE_CMAKE) && !defined(BUILD_FOR_NATIVE_PLATFORM) && !defined(BUILD_FOR_ESP32_IDF)
256256

257257
/**
258258
* Get the extents of the text provided in UTF8 as a flash based string using the F() macro

0 commit comments

Comments
 (0)