Browse Source

🎨 Update F string declarations

Scott Lahteine 3 years ago
parent
commit
23f10563e0
3 changed files with 9 additions and 8 deletions
  1. 7
    0
      Marlin/src/HAL/shared/Marduino.h
  2. 2
    1
      Marlin/src/HAL/shared/progmem.h
  3. 0
    7
      Marlin/src/core/types.h

+ 7
- 0
Marlin/src/HAL/shared/Marduino.h View File

87
 #endif
87
 #endif
88
 
88
 
89
 #include "progmem.h"
89
 #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))

+ 2
- 1
Marlin/src/HAL/shared/progmem.h View File

38
 #define PSTR(str) (str)
38
 #define PSTR(str) (str)
39
 #endif
39
 #endif
40
 #ifndef F
40
 #ifndef F
41
-#define F(str) (str)
41
+class __FlashStringHelper;
42
+#define F(str) (reinterpret_cast<const __FlashStringHelper *>(PSTR(str)))
42
 #endif
43
 #endif
43
 #ifndef _SFR_BYTE
44
 #ifndef _SFR_BYTE
44
 #define _SFR_BYTE(n) (n)
45
 #define _SFR_BYTE(n) (n)

+ 0
- 7
Marlin/src/core/types.h View File

26
 
26
 
27
 #include "../inc/MarlinConfigPre.h"
27
 #include "../inc/MarlinConfigPre.h"
28
 
28
 
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
-
36
 //
29
 //
37
 // Conditional type assignment magic. For example...
30
 // Conditional type assignment magic. For example...
38
 //
31
 //

Loading…
Cancel
Save