Skip to content

Commit 433a27e

Browse files
committed
🎨 Update F string declarations
1 parent 1de265e commit 433a27e

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

Marlin/src/HAL/shared/Marduino.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,10 @@
8787
#endif
8888

8989
#include "progmem.h"
90+
91+
class __FlashStringHelper;
92+
typedef const __FlashStringHelper* FSTR_P;
93+
#ifndef FPSTR
94+
#define FPSTR(S) (reinterpret_cast<FSTR_P>(S))
95+
#endif
96+
#define FTOP(S) (reinterpret_cast<const char*>(S))

Marlin/src/HAL/shared/progmem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
#define PSTR(str) (str)
3939
#endif
4040
#ifndef F
41-
#define F(str) (str)
41+
class __FlashStringHelper;
42+
#define F(str) (reinterpret_cast<const __FlashStringHelper *>(PSTR(str)))
4243
#endif
4344
#ifndef _SFR_BYTE
4445
#define _SFR_BYTE(n) (n)

Marlin/src/core/types.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626

2727
#include "../inc/MarlinConfigPre.h"
2828

29-
class __FlashStringHelper;
30-
typedef const __FlashStringHelper* FSTR_P;
31-
#ifndef FPSTR
32-
#define FPSTR(S) (reinterpret_cast<FSTR_P>(S))
33-
#endif
34-
#define FTOP(S) (reinterpret_cast<const char*>(S))
35-
3629
//
3730
// Conditional type assignment magic. For example...
3831
//

0 commit comments

Comments
 (0)