Browse Source

🩹 Fix TOUCH_UI_FTDI_EVE warnings

vanilla_fb_2.0.x
Scott Lahteine 3 years ago
parent
commit
ee1c1034e5
  1. 1
      Marlin/src/core/debug_out.h
  2. 4
      Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h
  3. 5
      Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp
  4. 2
      Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp
  5. 4
      Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/string_format.cpp

1
Marlin/src/core/debug_out.h

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

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

@ -296,3 +296,7 @@
#endif #endif
#endif // !__MARLIN_FIRMWARE__ #endif // !__MARLIN_FIRMWARE__
#ifndef SD_SPI_SPEED
#define SD_SPI_SPEED SPI_FULL_SPEED
#endif

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

@ -34,7 +34,6 @@ namespace FTDI {
#define CHAR_WIDTH(c) use_utf8 ? utf8_fm.get_char_width(c) : clcd_fm.char_widths[(uint8_t)c] #define CHAR_WIDTH(c) use_utf8 ? utf8_fm.get_char_width(c) : clcd_fm.char_widths[(uint8_t)c]
#else #else
#define CHAR_WIDTH(c) utf8_fm.get_char_width(c) #define CHAR_WIDTH(c) utf8_fm.get_char_width(c)
constexpr bool use_utf8 = false;
#endif #endif
FontMetrics utf8_fm(font); FontMetrics utf8_fm(font);
CLCD::FontMetrics clcd_fm; CLCD::FontMetrics clcd_fm;
@ -46,12 +45,12 @@ namespace FTDI {
// split and still allow the ellipsis to fit. // split and still allow the ellipsis to fit.
int16_t lineWidth = 0; int16_t lineWidth = 0;
char *breakPoint = str; char *breakPoint = str;
char *next = str; const char *next = str;
while (*next) { while (*next) {
const utf8_char_t c = get_utf8_char_and_inc(next); const utf8_char_t c = get_utf8_char_and_inc(next);
lineWidth += CHAR_WIDTH(c); lineWidth += CHAR_WIDTH(c);
if (lineWidth + ellipsisWidth < w) if (lineWidth + ellipsisWidth < w)
breakPoint = next; breakPoint = (char*)next;
} }
if (lineWidth > w) { if (lineWidth > w) {

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

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

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

@ -27,8 +27,10 @@
#define ROUND(val) uint16_t((val)+0.5) #define ROUND(val) uint16_t((val)+0.5)
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wno-format" #pragma GCC diagnostic ignored "-Wno-format"
#endif
/** /**
* Formats a temperature string (e.g. "100°C") * Formats a temperature string (e.g. "100°C")
@ -103,6 +105,8 @@ void format_position(char *str, float x, float y, float z) {
sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(MSG_UNITS_MM)); sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(MSG_UNITS_MM));
} }
#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif
#endif // TOUCH_UI_FTDI_EVE #endif // TOUCH_UI_FTDI_EVE

Loading…
Cancel
Save