Skip to content

Commit ee1c103

Browse files
committed
🩹 Fix TOUCH_UI_FTDI_EVE warnings
1 parent b661795 commit ee1c103

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

Marlin/src/core/debug_out.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
#include "debug_section.h"
5757
#define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D)
5858

59-
#define DEBUG_ECHOPGM_P(P) SERIAL_ECHOPGM_P(P)
6059
#define DEBUG_ECHO_START SERIAL_ECHO_START
6160
#define DEBUG_ERROR_START SERIAL_ERROR_START
6261
#define DEBUG_CHAR SERIAL_CHAR

Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,7 @@
296296
#endif
297297

298298
#endif // !__MARLIN_FIRMWARE__
299+
300+
#ifndef SD_SPI_SPEED
301+
#define SD_SPI_SPEED SPI_FULL_SPEED
302+
#endif

Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ namespace FTDI {
3434
#define CHAR_WIDTH(c) use_utf8 ? utf8_fm.get_char_width(c) : clcd_fm.char_widths[(uint8_t)c]
3535
#else
3636
#define CHAR_WIDTH(c) utf8_fm.get_char_width(c)
37-
constexpr bool use_utf8 = false;
3837
#endif
3938
FontMetrics utf8_fm(font);
4039
CLCD::FontMetrics clcd_fm;
@@ -46,12 +45,12 @@ namespace FTDI {
4645
// split and still allow the ellipsis to fit.
4746
int16_t lineWidth = 0;
4847
char *breakPoint = str;
49-
char *next = str;
48+
const char *next = str;
5049
while (*next) {
5150
const utf8_char_t c = get_utf8_char_and_inc(next);
5251
lineWidth += CHAR_WIDTH(c);
5352
if (lineWidth + ellipsisWidth < w)
54-
breakPoint = next;
53+
breakPoint = (char*)next;
5554
}
5655

5756
if (lineWidth > w) {

Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* character (this is not the unicode codepoint)
6767
*/
6868

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) {
7070
utf8_char_t val = *(uint8_t*)c++;
7171
if ((val & 0xC0) == 0xC0)
7272
while ((*c & 0xC0) == 0x80)

Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ namespace FTDI {
5151

5252
/* Returns the next character in a UTF8 string, without incrementing */
5353

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); }
5555

5656
void load_utf8_data(uint32_t addr);
5757
#else
5858
typedef char utf8_char_t;
5959

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; }
6262

6363
inline void load_utf8_data(uint32_t) {}
6464
#endif

Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/string_format.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727

2828
#define ROUND(val) uint16_t((val)+0.5)
2929

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
3234

3335
/**
3436
* Formats a temperature string (e.g. "100°C")
@@ -103,6 +105,8 @@ void format_position(char *str, float x, float y, float z) {
103105
sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(MSG_UNITS_MM));
104106
}
105107

106-
#pragma GCC diagnostic pop
108+
#if GCC_VERSION <= 50000
109+
#pragma GCC diagnostic pop
110+
#endif
107111

108112
#endif // TOUCH_UI_FTDI_EVE

0 commit comments

Comments
 (0)