Skip to content

Commit 0906aed

Browse files
committed
Fix incorrect definition of FPSTR() macro and move it from pgmspace.h to WString.h (espressif#1371)
1 parent 7d78247 commit 0906aed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: cores/esp32/WString.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class StringSumHelper;
3535
// an abstract class used as a means to proide a unique pointer type
3636
// but really has no body
3737
class __FlashStringHelper;
38-
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
38+
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
39+
#define F(string_literal) (FPSTR(PSTR(string_literal)))
3940

4041
// The string class
4142
class String {

Diff for: cores/esp32/pgmspace.h

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ typedef unsigned long prog_uint32_t;
3232
#define PROGMEM
3333
#define PGM_P const char *
3434
#define PGM_VOID_P const void *
35-
#define FPSTR(p) ((const char *)(p))
3635
#define PSTR(s) (s)
3736
#define _SFR_BYTE(n) (n)
3837

0 commit comments

Comments
 (0)