Browse Source

Fix, consolidate PSTR aliases (#20812)

Co-authored-by: Jason Smith <jason.inet@gmail.com>
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Rockman18 4 years ago
parent
commit
d0f953218f
No account linked to committer's email address

+ 0
- 10
Marlin/src/HAL/DUE/HAL.h View File

@@ -83,16 +83,6 @@
83 83
 // On AVR this is in math.h?
84 84
 #define square(x) ((x)*(x))
85 85
 
86
-#ifndef strncpy_P
87
-  #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
88
-#endif
89
-
90
-// Fix bug in pgm_read_ptr
91
-#undef pgm_read_ptr
92
-#define pgm_read_ptr(addr) (*((void**)(addr)))
93
-#undef pgm_read_word
94
-#define pgm_read_word(addr) (*((uint16_t*)(addr)))
95
-
96 86
 typedef int8_t pin_t;
97 87
 
98 88
 #define SHARED_SERVOS HAS_SERVOS

+ 0
- 4
Marlin/src/HAL/ESP32/HAL.h View File

@@ -67,10 +67,6 @@ extern portMUX_TYPE spinlock;
67 67
 #define ENABLE_ISRS()  if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock)
68 68
 #define DISABLE_ISRS() portENTER_CRITICAL(&spinlock)
69 69
 
70
-// Fix bug in pgm_read_ptr
71
-#undef pgm_read_ptr
72
-#define pgm_read_ptr(addr) (*(addr))
73
-
74 70
 // ------------------------
75 71
 // Types
76 72
 // ------------------------

+ 0
- 5
Marlin/src/HAL/LINUX/HAL.h View File

@@ -113,8 +113,3 @@ inline void HAL_reboot() {}  // reboot the board or restart the bootloader
113 113
 FORCE_INLINE static void DELAY_CYCLES(uint64_t x) {
114 114
   Clock::delayCycles(x);
115 115
 }
116
-
117
-// Add strcmp_P if missing
118
-#ifndef strcmp_P
119
-  #define strcmp_P(a, b) strcmp((a), (b))
120
-#endif

+ 0
- 21
Marlin/src/HAL/LINUX/include/Arduino.h View File

@@ -73,27 +73,6 @@ extern "C" {
73 73
   void GpioDisableInt(uint32_t port, uint32_t pin);
74 74
 }
75 75
 
76
-// Program Memory
77
-#define pgm_read_ptr(addr)        (*((void**)(addr)))
78
-#define pgm_read_byte_near(addr)  (*((uint8_t*)(addr)))
79
-#define pgm_read_float_near(addr) (*((float*)(addr)))
80
-#define pgm_read_word_near(addr)  (*((uint16_t*)(addr)))
81
-#define pgm_read_dword_near(addr) (*((uint32_t*)(addr)))
82
-#define pgm_read_byte(addr)       pgm_read_byte_near(addr)
83
-#define pgm_read_float(addr)      pgm_read_float_near(addr)
84
-#define pgm_read_word(addr)       pgm_read_word_near(addr)
85
-#define pgm_read_dword(addr)      pgm_read_dword_near(addr)
86
-
87
-using std::memcpy;
88
-#define memcpy_P memcpy
89
-#define sprintf_P sprintf
90
-#define strstr_P strstr
91
-#define strncpy_P strncpy
92
-#define vsnprintf_P vsnprintf
93
-#define strcpy_P strcpy
94
-#define snprintf_P snprintf
95
-#define strlen_P strlen
96
-
97 76
 // Time functions
98 77
 extern "C" void delay(const int milis);
99 78
 void _delay_ms(const int delay);

+ 0
- 13
Marlin/src/HAL/LPC1768/HAL.h View File

@@ -214,16 +214,3 @@ void HAL_clear_reset_source(void);
214 214
 uint8_t HAL_get_reset_source(void);
215 215
 
216 216
 inline void HAL_reboot() {}  // reboot the board or restart the bootloader
217
-
218
-// Add strcmp_P if missing
219
-#ifndef strcmp_P
220
-  #define strcmp_P(a, b) strcmp((a), (b))
221
-#endif
222
-
223
-#ifndef strcat_P
224
-  #define strcat_P(a, b) strcat((a), (b))
225
-#endif
226
-
227
-#ifndef strcpy_P
228
-  #define strcpy_P(a, b) strcpy((a), (b))
229
-#endif

+ 0
- 8
Marlin/src/HAL/STM32/HAL.h View File

@@ -106,14 +106,6 @@
106 106
 // On AVR this is in math.h?
107 107
 #define square(x) ((x)*(x))
108 108
 
109
-#ifndef strncpy_P
110
-  #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
111
-#endif
112
-
113
-// Fix bug in pgm_read_ptr
114
-#undef pgm_read_ptr
115
-#define pgm_read_ptr(addr) (*(addr))
116
-
117 109
 // ------------------------
118 110
 // Types
119 111
 // ------------------------

+ 0
- 8
Marlin/src/HAL/STM32F1/HAL.h View File

@@ -152,14 +152,6 @@ void HAL_idletask();
152 152
 // On AVR this is in math.h?
153 153
 #define square(x) ((x)*(x))
154 154
 
155
-#ifndef strncpy_P
156
-  #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
157
-#endif
158
-
159
-// Fix bug in pgm_read_ptr
160
-#undef pgm_read_ptr
161
-#define pgm_read_ptr(addr) (*(addr))
162
-
163 155
 #define RST_POWER_ON   1
164 156
 #define RST_EXTERNAL   2
165 157
 #define RST_BROWN_OUT  4

+ 0
- 11
Marlin/src/HAL/TEENSY31_32/HAL.h View File

@@ -74,17 +74,6 @@ typedef int8_t pin_t;
74 74
 #define ENABLE_ISRS()  __enable_irq()
75 75
 #define DISABLE_ISRS() __disable_irq()
76 76
 
77
-#ifndef strncpy_P
78
-  #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
79
-#endif
80
-
81
-// Fix bug in pgm_read_ptr
82
-#undef pgm_read_ptr
83
-#define pgm_read_ptr(addr) (*((void**)(addr)))
84
-// Add type-checking to pgm_read_word
85
-#undef pgm_read_word
86
-#define pgm_read_word(addr) (*((uint16_t*)(addr)))
87
-
88 77
 inline void HAL_init() {}
89 78
 
90 79
 // Clear the reset reason

+ 0
- 11
Marlin/src/HAL/TEENSY35_36/HAL.h View File

@@ -80,17 +80,6 @@ typedef int8_t pin_t;
80 80
 #undef sq
81 81
 #define sq(x) ((x)*(x))
82 82
 
83
-#ifndef strncpy_P
84
-  #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
85
-#endif
86
-
87
-// Fix bug in pgm_read_ptr
88
-#undef pgm_read_ptr
89
-#define pgm_read_ptr(addr) (*((void**)(addr)))
90
-// Add type-checking to pgm_read_word
91
-#undef pgm_read_word
92
-#define pgm_read_word(addr) (*((uint16_t*)(addr)))
93
-
94 83
 inline void HAL_init() {}
95 84
 
96 85
 // Clear reset reason

+ 0
- 11
Marlin/src/HAL/TEENSY40_41/HAL.h View File

@@ -92,21 +92,10 @@ typedef int8_t pin_t;
92 92
 #undef sq
93 93
 #define sq(x) ((x)*(x))
94 94
 
95
-#ifndef strncpy_P
96
-  #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
97
-#endif
98
-
99 95
 // Don't place string constants in PROGMEM
100 96
 #undef PSTR
101 97
 #define PSTR(str) ({static const char *data = (str); &data[0];})
102 98
 
103
-// Fix bug in pgm_read_ptr
104
-#undef pgm_read_ptr
105
-#define pgm_read_ptr(addr) (*((void**)(addr)))
106
-// Add type-checking to pgm_read_word
107
-#undef pgm_read_word
108
-#define pgm_read_word(addr) (*((uint16_t*)(addr)))
109
-
110 99
 // Enable hooks into idle and setup for HAL
111 100
 #define HAL_IDLETASK 1
112 101
 FORCE_INLINE void HAL_idletask() {}

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

@@ -81,3 +81,5 @@
81 81
 #ifndef UNUSED
82 82
   #define UNUSED(x) ((void)(x))
83 83
 #endif
84
+
85
+#include "progmem.h"

+ 189
- 0
Marlin/src/HAL/shared/progmem.h View File

@@ -0,0 +1,189 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#ifndef __AVR__
25
+#ifndef __PGMSPACE_H_
26
+// This define should prevent reading the system pgmspace.h if included elsewhere
27
+// This is not normally needed.
28
+#define __PGMSPACE_H_ 1
29
+#endif
30
+
31
+#ifndef PROGMEM
32
+#define PROGMEM
33
+#endif
34
+#ifndef PGM_P
35
+#define PGM_P  const char *
36
+#endif
37
+#ifndef PSTR
38
+#define PSTR(str) (str)
39
+#endif
40
+#ifndef F
41
+#define F(str) (str)
42
+#endif
43
+#ifndef _SFR_BYTE
44
+#define _SFR_BYTE(n) (n)
45
+#endif
46
+#ifndef memchr_P
47
+#define memchr_P(str, c, len) memchr((str), (c), (len))
48
+#endif
49
+#ifndef memcmp_P
50
+#define memcmp_P(a, b, n) memcmp((a), (b), (n))
51
+#endif
52
+#ifndef memcpy_P
53
+#define memcpy_P(dest, src, num) memcpy((dest), (src), (num))
54
+#endif
55
+#ifndef memmem_P
56
+#define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen))
57
+#endif
58
+#ifndef memrchr_P
59
+#define memrchr_P(str, val, len) memrchr((str), (val), (len))
60
+#endif
61
+#ifndef strcat_P
62
+#define strcat_P(dest, src) strcat((dest), (src))
63
+#endif
64
+#ifndef strchr_P
65
+#define strchr_P(str, c) strchr((str), (c))
66
+#endif
67
+#ifndef strchrnul_P
68
+#define strchrnul_P(str, c) strchrnul((str), (c))
69
+#endif
70
+#ifndef strcmp_P
71
+#define strcmp_P(a, b) strcmp((a), (b))
72
+#endif
73
+#ifndef strcpy_P
74
+#define strcpy_P(dest, src) strcpy((dest), (src))
75
+#endif
76
+#ifndef strcasecmp_P
77
+#define strcasecmp_P(a, b) strcasecmp((a), (b))
78
+#endif
79
+#ifndef strcasestr_P
80
+#define strcasestr_P(a, b) strcasestr((a), (b))
81
+#endif
82
+#ifndef strlcat_P
83
+#define strlcat_P(dest, src, len) strlcat((dest), (src), (len))
84
+#endif
85
+#ifndef strlcpy_P
86
+#define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len))
87
+#endif
88
+#ifndef strlen_P
89
+#define strlen_P(s) strlen((const char *)(s))
90
+#endif
91
+#ifndef strnlen_P
92
+#define strnlen_P(str, len) strnlen((str), (len))
93
+#endif
94
+#ifndef strncmp_P
95
+#define strncmp_P(a, b, n) strncmp((a), (b), (n))
96
+#endif
97
+#ifndef strncasecmp_P
98
+#define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n))
99
+#endif
100
+#ifndef strncat_P
101
+#define strncat_P(a, b, n) strncat((a), (b), (n))
102
+#endif
103
+#ifndef strncpy_P
104
+#define strncpy_P(a, b, n) strncmp((a), (b), (n))
105
+#endif
106
+#ifndef strpbrk_P
107
+#define strpbrk_P(str, chrs) strpbrk((str), (chrs))
108
+#endif
109
+#ifndef strrchr_P
110
+#define strrchr_P(str, c) strrchr((str), (c))
111
+#endif
112
+#ifndef strsep_P
113
+#define strsep_P(strp, delim) strsep((strp), (delim))
114
+#endif
115
+#ifndef strspn_P
116
+#define strspn_P(str, chrs) strspn((str), (chrs))
117
+#endif
118
+#ifndef strstr_P
119
+#define strstr_P(a, b) strstr((a), (b))
120
+#endif
121
+#ifndef sprintf_P
122
+#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__)
123
+#endif
124
+#ifndef vfprintf_P
125
+#define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__)
126
+#endif
127
+#ifndef printf_P
128
+#define printf_P(...) printf(__VA_ARGS__)
129
+#endif
130
+#ifndef snprintf_P
131
+#define snprintf_P(s, n, ...) snprintf((s), (n), __VA_ARGS__)
132
+#endif
133
+#ifndef vsprintf_P
134
+#define vsprintf_P(s, ...) vsprintf((s),__VA_ARGS__)
135
+#endif
136
+#ifndef vsnprintf_P
137
+#define vsnprintf_P(s, n, ...) vsnprintf((s), (n),__VA_ARGS__)
138
+#endif
139
+#ifndef fprintf_P
140
+#define fprintf_P(s, ...) fprintf((s), __VA_ARGS__)
141
+#endif
142
+
143
+#ifndef pgm_read_byte
144
+#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
145
+#endif
146
+#ifndef pgm_read_word
147
+#define pgm_read_word(addr) (*(const unsigned short *)(addr))
148
+#endif
149
+#ifndef pgm_read_dword
150
+#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
151
+#endif
152
+#ifndef pgm_read_float
153
+#define pgm_read_float(addr) (*(const float *)(addr))
154
+#endif
155
+
156
+#ifndef pgm_read_byte_near
157
+#define pgm_read_byte_near(addr) pgm_read_byte(addr)
158
+#endif
159
+#ifndef pgm_read_word_near
160
+#define pgm_read_word_near(addr) pgm_read_word(addr)
161
+#endif
162
+#ifndef pgm_read_dword_near
163
+#define pgm_read_dword_near(addr) pgm_read_dword(addr)
164
+#endif
165
+#ifndef pgm_read_float_near
166
+#define pgm_read_float_near(addr) pgm_read_float(addr)
167
+#endif
168
+#ifndef pgm_read_byte_far
169
+#define pgm_read_byte_far(addr) pgm_read_byte(addr)
170
+#endif
171
+#ifndef pgm_read_word_far
172
+#define pgm_read_word_far(addr) pgm_read_word(addr)
173
+#endif
174
+#ifndef pgm_read_dword_far
175
+#define pgm_read_dword_far(addr) pgm_read_dword(addr)
176
+#endif
177
+#ifndef pgm_read_float_far
178
+#define pgm_read_float_far(addr) pgm_read_float(addr)
179
+#endif
180
+
181
+#ifndef pgm_read_pointer
182
+#define pgm_read_pointer
183
+#endif
184
+
185
+// Fix bug in pgm_read_ptr
186
+#undef pgm_read_ptr
187
+#define pgm_read_ptr(addr) (*((void**)(addr)))
188
+
189
+#endif // __AVR__

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp View File

@@ -257,7 +257,7 @@ void lv_draw_dialog(uint8_t type) {
257 257
         lv_label_set_text(labelOk, print_file_dialog_menu.confirm);
258 258
       }
259 259
     }
260
-    else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMARE)) {
260
+    else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMWARE)) {
261 261
       // nothing to do
262 262
     }
263 263
   #endif
@@ -426,7 +426,7 @@ void lv_draw_dialog(uint8_t type) {
426 426
         lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
427 427
       }
428 428
     }
429
-    else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMARE)) {
429
+    else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMWARE)) {
430 430
       lv_label_set_text(labelDialog, DIALOG_UPDATE_WIFI_FIRMWARE_EN);
431 431
       lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20);
432 432
     }

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h View File

@@ -77,7 +77,7 @@
77 77
 #include "draw_keyboard.h"
78 78
 #include "draw_encoder_settings.h"
79 79
 
80
-#include "../../inc/MarlinConfigPre.h"
80
+#include "../../../../inc/MarlinConfigPre.h"
81 81
 
82 82
 #if ENABLED(MKS_WIFI_MODULE)
83 83
   #include "wifiSerial.h"

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp View File

@@ -1663,7 +1663,7 @@ void mks_esp_wifi_init() {
1663 1663
 
1664 1664
         clear_cur_ui();
1665 1665
 
1666
-        draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMARE);
1666
+        draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMWARE);
1667 1667
         if (wifi_upload(1) >= 0) {
1668 1668
 
1669 1669
           f_unlink("1:/MKS_WIFI_CUR");
@@ -1717,7 +1717,7 @@ void mks_wifi_firmware_update() {
1717 1717
 
1718 1718
     clear_cur_ui();
1719 1719
 
1720
-    lv_draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMARE);
1720
+    lv_draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMWARE);
1721 1721
 
1722 1722
     lv_task_handler();
1723 1723
     watchdog_refresh();

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp View File

@@ -152,7 +152,7 @@ uint32_t getData(unsigned byteCnt, const uint8_t *buf, int ofst) {
152 152
   uint32_t val = 0;
153 153
   if (buf && byteCnt) {
154 154
     unsigned int shiftCnt = 0;
155
-    NOMORE(byteCnt, 4);
155
+    NOMORE(byteCnt, 4U);
156 156
     do {
157 157
       val |= (uint32_t)buf[ofst++] << shiftCnt;
158 158
       shiftCnt += 8;
@@ -164,7 +164,7 @@ uint32_t getData(unsigned byteCnt, const uint8_t *buf, int ofst) {
164 164
 // Put 1-4 bytes of a value in little-endian order into a buffer beginning at a specified offset.
165 165
 void putData(uint32_t val, unsigned byteCnt, uint8_t *buf, int ofst) {
166 166
   if (buf && byteCnt) {
167
-    NOMORE(byteCnt, 4);
167
+    NOMORE(byteCnt, 4U);
168 168
     do {
169 169
       buf[ofst++] = (uint8_t)(val & 0xFF);
170 170
       val >>= 8;

+ 1
- 163
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h View File

@@ -144,169 +144,7 @@ e-mail   :  support@circuitsathome.com
144 144
 #define UHS_GET_DPI(x) (x)
145 145
 #endif
146 146
 
147
-#ifndef __AVR__
148
-#ifndef __PGMSPACE_H_
149
-// This define should prevent reading the system pgmspace.h if included elsewhere
150
-// This is not normally needed.
151
-#define __PGMSPACE_H_ 1
152
-#endif
153
-
154
-#ifndef PROGMEM
155
-#define PROGMEM
156
-#endif
157
-#ifndef PGM_P
158
-#define PGM_P  const char *
159
-#endif
160
-#ifndef PSTR
161
-#define PSTR(str) (str)
162
-#endif
163
-#ifndef F
164
-#define F(str) (str)
165
-#endif
166
-#ifndef _SFR_BYTE
167
-#define _SFR_BYTE(n) (n)
168
-#endif
169
-#ifndef memchr_P
170
-#define memchr_P(str, c, len) memchr((str), (c), (len))
171
-#endif
172
-#ifndef memcmp_P
173
-#define memcmp_P(a, b, n) memcmp((a), (b), (n))
174
-#endif
175
-#ifndef memcpy_P
176
-#define memcpy_P(dest, src, num) memcpy((dest), (src), (num))
177
-#endif
178
-#ifndef memmem_P
179
-#define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen))
180
-#endif
181
-#ifndef memrchr_P
182
-#define memrchr_P(str, val, len) memrchr((str), (val), (len))
183
-#endif
184
-#ifndef strcat_P
185
-#define strcat_P(dest, src) strcat((dest), (src))
186
-#endif
187
-#ifndef strchr_P
188
-#define strchr_P(str, c) strchr((str), (c))
189
-#endif
190
-#ifndef strchrnul_P
191
-#define strchrnul_P(str, c) strchrnul((str), (c))
192
-#endif
193
-#ifndef strcmp_P
194
-#define strcmp_P(a, b) strcmp((a), (b))
195
-#endif
196
-#ifndef strcpy_P
197
-#define strcpy_P(dest, src) strcpy((dest), (src))
198
-#endif
199
-#ifndef strcasecmp_P
200
-#define strcasecmp_P(a, b) strcasecmp((a), (b))
201
-#endif
202
-#ifndef strcasestr_P
203
-#define strcasestr_P(a, b) strcasestr((a), (b))
204
-#endif
205
-#ifndef strlcat_P
206
-#define strlcat_P(dest, src, len) strlcat((dest), (src), (len))
207
-#endif
208
-#ifndef strlcpy_P
209
-#define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len))
210
-#endif
211
-#ifndef strlen_P
212
-#define strlen_P(s) strlen((const char *)(s))
213
-#endif
214
-#ifndef strnlen_P
215
-#define strnlen_P(str, len) strnlen((str), (len))
216
-#endif
217
-#ifndef strncmp_P
218
-#define strncmp_P(a, b, n) strncmp((a), (b), (n))
219
-#endif
220
-#ifndef strncasecmp_P
221
-#define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n))
222
-#endif
223
-#ifndef strncat_P
224
-#define strncat_P(a, b, n) strncat((a), (b), (n))
225
-#endif
226
-#ifndef strncpy_P
227
-#define strncpy_P(a, b, n) strncmp((a), (b), (n))
228
-#endif
229
-#ifndef strpbrk_P
230
-#define strpbrk_P(str, chrs) strpbrk((str), (chrs))
231
-#endif
232
-#ifndef strrchr_P
233
-#define strrchr_P(str, c) strrchr((str), (c))
234
-#endif
235
-#ifndef strsep_P
236
-#define strsep_P(strp, delim) strsep((strp), (delim))
237
-#endif
238
-#ifndef strspn_P
239
-#define strspn_P(str, chrs) strspn((str), (chrs))
240
-#endif
241
-#ifndef strstr_P
242
-#define strstr_P(a, b) strstr((a), (b))
243
-#endif
244
-#ifndef sprintf_P
245
-#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__)
246
-#endif
247
-#ifndef vfprintf_P
248
-#define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__)
249
-#endif
250
-#ifndef printf_P
251
-#define printf_P(...) printf(__VA_ARGS__)
252
-#endif
253
-#ifndef snprintf_P
254
-#define snprintf_P(s, n, ...) ((s), (n), __VA_ARGS__)
255
-#endif
256
-#ifndef vsprintf_P
257
-#define vsprintf_P(s, ...) ((s),__VA_ARGS__)
258
-#endif
259
-#ifndef vsnprintf_P
260
-#define vsnprintf_P(s, n, ...) ((s), (n),__VA_ARGS__)
261
-#endif
262
-#ifndef fprintf_P
263
-#define fprintf_P(s, ...) ((s), __VA_ARGS__)
264
-#endif
265
-
266
-#ifndef pgm_read_byte
267
-#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
268
-#endif
269
-#ifndef pgm_read_word
270
-#define pgm_read_word(addr) (*(const unsigned short *)(addr))
271
-#endif
272
-#ifndef pgm_read_dword
273
-#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
274
-#endif
275
-#ifndef pgm_read_float
276
-#define pgm_read_float(addr) (*(const float *)(addr))
277
-#endif
278
-
279
-#ifndef pgm_read_byte_near
280
-#define pgm_read_byte_near(addr) pgm_read_byte(addr)
281
-#endif
282
-#ifndef pgm_read_word_near
283
-#define pgm_read_word_near(addr) pgm_read_word(addr)
284
-#endif
285
-#ifndef pgm_read_dword_near
286
-#define pgm_read_dword_near(addr) pgm_read_dword(addr)
287
-#endif
288
-#ifndef pgm_read_float_near
289
-#define pgm_read_float_near(addr) pgm_read_float(addr)
290
-#endif
291
-#ifndef pgm_read_byte_far
292
-#define pgm_read_byte_far(addr) pgm_read_byte(addr)
293
-#endif
294
-#ifndef pgm_read_word_far
295
-#define pgm_read_word_far(addr) pgm_read_word(addr)
296
-#endif
297
-#ifndef pgm_read_dword_far
298
-#define pgm_read_dword_far(addr) pgm_read_dword(addr)
299
-#endif
300
-#ifndef pgm_read_float_far
301
-#define pgm_read_float_far(addr) pgm_read_float(addr)
302
-#endif
303
-
304
-#ifndef pgm_read_pointer
305
-#define pgm_read_pointer
306
-#endif
307
-
308
-#endif
309
-
147
+#include "../../../../HAL/shared/progmem.h"
310 148
 
311 149
 ////////////////////////////////////////////////////////////////////////////////
312 150
 // HANDY MACROS

+ 3
- 3
buildroot/tests/mks_robin_nano35-tests View File

@@ -30,9 +30,9 @@ exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" "$3"
30 30
 #
31 31
 use_example_configs Mks/Robin
32 32
 opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2
33
-opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240
34
-opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320
35
-exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" "$3"
33
+opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 SERIAL_PORT_2
34
+opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 MKS_WIFI_MODULE
35
+exec_test $1 $2 "MKS Robin v2 nano LVGL SPI w/ WiFi" "$3"
36 36
 
37 37
 #
38 38
 # MKS Robin v2 nano New Color UI 480x320 SPI

Loading…
Cancel
Save