浏览代码

🩹 Fix TOUCH_UI_FTDI_EVE warnings

Scott Lahteine 4 年前
父节点
当前提交
ce6d622501

+ 0
- 1
Marlin/src/core/debug_out.h 查看文件

@@ -56,7 +56,6 @@
56 56
   #include "debug_section.h"
57 57
   #define DEBUG_SECTION(N,S,D)    SectionLog N(PSTR(S),D)
58 58
 
59
-  #define DEBUG_ECHOPGM_P(P)      SERIAL_ECHOPGM_P(P)
60 59
   #define DEBUG_ECHO_START        SERIAL_ECHO_START
61 60
   #define DEBUG_ERROR_START       SERIAL_ERROR_START
62 61
   #define DEBUG_CHAR              SERIAL_CHAR

+ 4
- 0
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h 查看文件

@@ -296,3 +296,7 @@
296 296
   #endif
297 297
 
298 298
 #endif // !__MARLIN_FIRMWARE__
299
+
300
+#ifndef SD_SPI_SPEED
301
+  #define SD_SPI_SPEED SPI_FULL_SPEED
302
+#endif

+ 2
- 3
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp 查看文件

@@ -34,7 +34,6 @@ namespace FTDI {
34 34
       #define CHAR_WIDTH(c) use_utf8 ? utf8_fm.get_char_width(c) : clcd_fm.char_widths[(uint8_t)c]
35 35
     #else
36 36
       #define CHAR_WIDTH(c) utf8_fm.get_char_width(c)
37
-      constexpr bool use_utf8 = false;
38 37
     #endif
39 38
     FontMetrics utf8_fm(font);
40 39
     CLCD::FontMetrics clcd_fm;
@@ -46,12 +45,12 @@ namespace FTDI {
46 45
     // split and still allow the ellipsis to fit.
47 46
     int16_t lineWidth = 0;
48 47
     char *breakPoint = str;
49
-    char *next = str;
48
+    const char *next = str;
50 49
     while (*next) {
51 50
       const utf8_char_t c = get_utf8_char_and_inc(next);
52 51
       lineWidth += CHAR_WIDTH(c);
53 52
       if (lineWidth + ellipsisWidth < w)
54
-        breakPoint = next;
53
+        breakPoint = (char*)next;
55 54
     }
56 55
 
57 56
     if (lineWidth > w) {

+ 1
- 1
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp 查看文件

@@ -66,7 +66,7 @@
66 66
    *          character (this is not the unicode codepoint)
67 67
    */
68 68
 
69
-  utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) {
69
+  utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) {
70 70
     utf8_char_t val = *(uint8_t*)c++;
71 71
     if ((val & 0xC0) == 0xC0)
72 72
       while ((*c & 0xC0) == 0x80)

+ 3
- 3
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h 查看文件

@@ -51,14 +51,14 @@ namespace FTDI {
51 51
 
52 52
     /* Returns the next character in a UTF8 string, without incrementing */
53 53
 
54
-    inline utf8_char_t get_utf8_char(const char *c) {return get_utf8_char_and_inc(c);}
54
+    inline utf8_char_t get_utf8_char(const char *c) { return get_utf8_char_and_inc(c); }
55 55
 
56 56
     void load_utf8_data(uint32_t addr);
57 57
   #else
58 58
     typedef char utf8_char_t;
59 59
 
60
-    inline utf8_char_t get_utf8_char_and_inc(const char *&c) {return *c++;}
61
-    inline utf8_char_t get_utf8_char(const char *c) {return *c;}
60
+    inline utf8_char_t get_utf8_char_and_inc(const char *&c) { return *c++; }
61
+    inline utf8_char_t get_utf8_char(const char *c) { return *c; }
62 62
 
63 63
     inline void load_utf8_data(uint32_t) {}
64 64
   #endif

+ 7
- 3
Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/string_format.cpp 查看文件

@@ -27,8 +27,10 @@
27 27
 
28 28
 #define ROUND(val) uint16_t((val)+0.5)
29 29
 
30
-#pragma GCC diagnostic push
31
-#pragma GCC diagnostic ignored "-Wno-format"
30
+#if GCC_VERSION <= 50000
31
+  #pragma GCC diagnostic push
32
+  #pragma GCC diagnostic ignored "-Wno-format"
33
+#endif
32 34
 
33 35
 /**
34 36
  * Formats a temperature string (e.g. "100°C")
@@ -103,6 +105,8 @@ void format_position(char *str, float x, float y, float z) {
103 105
   sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(MSG_UNITS_MM));
104 106
 }
105 107
 
106
-#pragma GCC diagnostic pop
108
+#if GCC_VERSION <= 50000
109
+  #pragma GCC diagnostic pop
110
+#endif
107 111
 
108 112
 #endif // TOUCH_UI_FTDI_EVE

正在加载...
取消
保存