Skip to content

Commit 31773cf

Browse files
committed
fix F macro
1 parent 7530db5 commit 31773cf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Diff for: cores/esp32/WString.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,15 @@
2626
#include <stdlib.h>
2727
#include <string.h>
2828
#include <ctype.h>
29-
//#include <pgmspace.h>
29+
#include <pgmspace.h>
3030

3131
// An inherited class for holding the result of a concatenation. These
3232
// result objects are assumed to be writable by subsequent concatenations.
3333
class StringSumHelper;
3434

3535
// an abstract class used as a means to proide a unique pointer type
3636
// but really has no body
37-
class __FlashStringHelper;
38-
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
39-
#define F(string_literal) (FPSTR(PSTR(string_literal)))
37+
//class __FlashStringHelper;
4038

4139
// The string class
4240
class String

Diff for: cores/esp32/pgmspace.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
typedef char __FlashStringHelper;
2323
#define PROGMEM
2424
#define PSTR(s) (s)
25-
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
25+
#define FPSTR(pstr_pointer) ((const char *)(pstr_pointer))
26+
#define F(string_literal) (string_literal)
2627

2728
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
2829
#define pgm_read_word(addr) (*(const unsigned short *)(addr))

0 commit comments

Comments
 (0)