浏览代码

🎨 Update F string declarations

Scott Lahteine 3 年前
父节点
当前提交
23f10563e0
共有 3 个文件被更改,包括 9 次插入8 次删除
  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 查看文件

@@ -87,3 +87,10 @@
87 87
 #endif
88 88
 
89 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 查看文件

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

+ 0
- 7
Marlin/src/core/types.h 查看文件

@@ -26,13 +26,6 @@
26 26
 
27 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 30
 // Conditional type assignment magic. For example...
38 31
 //

正在加载...
取消
保存