1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-26 21:36:21 +00:00

FTDI whitespace tweaks

This commit is contained in:
Scott Lahteine 2020-06-11 15:19:28 -05:00
parent bbe8400c5a
commit fe969ec6d3
19 changed files with 270 additions and 266 deletions

View File

@ -497,7 +497,8 @@ bool UIFlashStorage::is_present = false;
if (verifyOk) { if (verifyOk) {
SERIAL_ECHOLNPGM("DONE"); SERIAL_ECHOLNPGM("DONE");
return SUCCESS; return SUCCESS;
} else { }
else {
SERIAL_ECHOLNPGM("FAIL"); SERIAL_ECHOLNPGM("FAIL");
return VERIFY_ERROR; return VERIFY_ERROR;
} }

View File

@ -932,7 +932,8 @@ template <class T> bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len
if (command_read_ptr <= command_write_ptr) { if (command_read_ptr <= command_write_ptr) {
bytes_tail = 4096U - command_write_ptr; bytes_tail = 4096U - command_write_ptr;
bytes_head = command_read_ptr; bytes_head = command_read_ptr;
} else { }
else {
bytes_tail = command_read_ptr - command_write_ptr; bytes_tail = command_read_ptr - command_write_ptr;
bytes_head = 0; bytes_head = 0;
} }

View File

@ -78,7 +78,8 @@ class CommandProcessor : public CLCD::CommandFifo {
y += (h - th) / 2; y += (h - th) / 2;
w -= tracker ? th * 5.0 : th * 2; w -= tracker ? th * 5.0 : th * 2;
h = th; h = th;
} else { }
else {
x += (w - th) / 2; x += (w - th) / 2;
y += tracker ? th * 2.5 : th; y += tracker ? th * 2.5 : th;
w = th; w = th;
@ -254,7 +255,8 @@ class CommandProcessor : public CLCD::CommandFifo {
if (is_tracking) { if (is_tracking) {
if (FTDI::EventLoop::is_touch_held()) { if (FTDI::EventLoop::is_touch_held()) {
return CLCD::get_tracker(value); return CLCD::get_tracker(value);
} else { }
else {
CLCD::CommandFifo::track(0, 0, 0, 0, 0); CLCD::CommandFifo::track(0, 0, 0, 0, 0);
CLCD::CommandFifo::execute(); CLCD::CommandFifo::execute();
is_tracking = false; is_tracking = false;
@ -319,7 +321,8 @@ class CommandProcessor : public CLCD::CommandFifo {
if (is_utf8) { if (is_utf8) {
width = get_utf8_text_width(text, font_size_t::from_romfont(font)); width = get_utf8_text_width(text, font_size_t::from_romfont(font));
height = font_size_t::from_romfont(font).get_height(); height = font_size_t::from_romfont(font).get_height();
} else }
else
#endif #endif
{ {
CLCD::FontMetrics fm(font); CLCD::FontMetrics fm(font);

View File

@ -33,10 +33,10 @@
* DLCache dlcache(UNIQUE_ID); * DLCache dlcache(UNIQUE_ID);
* *
* if (dlcache.hasData()) { * if (dlcache.hasData()) {
* dlcache.append(); * dlcache.append();
* } else { * } else {
* // Add stuff to the DL * // Add stuff to the DL
* dlcache.store(); * dlcache.store();
* } * }
*/ */
class DLCache { class DLCache {

View File

@ -140,15 +140,12 @@ namespace FTDI {
if (UIData::flags.bits.touch_start_sound) sound.play(press_sound); if (UIData::flags.bits.touch_start_sound) sound.play(press_sound);
} }
if (lastScreen != current_screen.getScreen()) { // In the case in which a touch event triggered a new screen to be
// In the case in which a touch event triggered a new screen to be // drawn, we don't issue a touchEnd since it would be sent to the
// drawn, we don't issue a touchEnd since it would be sent to the // wrong screen.
// wrong screen. UIData::flags.bits.ignore_unpress = (lastScreen != current_screen.getScreen());
UIData::flags.bits.ignore_unpress = true; }
} else { else {
UIData::flags.bits.ignore_unpress = false;
}
} else {
touch_timer.start(); touch_timer.start();
} }
break; break;

View File

@ -209,7 +209,8 @@ class CachedScreen {
if (dlcache.has_data()) { if (dlcache.has_data()) {
dlcache.append(); dlcache.append();
} else { }
else {
#ifdef TOUCH_UI_USE_UTF8 #ifdef TOUCH_UI_USE_UTF8
load_utf8_bitmaps(cmd); load_utf8_bitmaps(cmd);
#endif #endif

View File

@ -98,7 +98,8 @@ namespace FTDI {
if (ms == 0 && fx == SILENCE && nt == END_SONG) { if (ms == 0 && fx == SILENCE && nt == END_SONG) {
sequence = 0; sequence = 0;
play(SILENCE, REST); play(SILENCE, REST);
} else { }
else {
wait = ms; wait = ms;
timer.start(); timer.start();
play(fx, nt); play(fx, nt);

View File

@ -45,7 +45,8 @@ namespace FTDI {
cmd.cmd(BITMAP_HANDLE(handle)); cmd.cmd(BITMAP_HANDLE(handle));
cmd.cmd(CELL(cell)); cmd.cmd(CELL(cell));
cmd.cmd(VERTEX2F(x * 16, y * 16)); cmd.cmd(VERTEX2F(x * 16, y * 16));
} else { }
else {
cmd.cmd(VERTEX2II(x, y, handle, cell)); cmd.cmd(VERTEX2II(x, y, handle, cell));
} }
} }

View File

@ -21,7 +21,7 @@
#include "../ftdi_extended.h" #include "../ftdi_extended.h"
#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) #if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8)
namespace FTDI { namespace FTDI {
// Returns the height of a standard FTDI romfont // Returns the height of a standard FTDI romfont

View File

@ -21,7 +21,7 @@
#include "../ftdi_extended.h" #include "../ftdi_extended.h"
#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) #if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8)
constexpr static uint8_t std_font = 31; constexpr static uint8_t std_font = 31;

View File

@ -21,7 +21,7 @@
#include "../ftdi_extended.h" #include "../ftdi_extended.h"
#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) #if BOTH(FTDI_EXTENDED, TOUCH_UI_USE_UTF8)
using namespace FTDI; using namespace FTDI;

View File

@ -21,7 +21,7 @@
#include "../ftdi_extended.h" #include "../ftdi_extended.h"
#if defined(FTDI_EXTENDED) && BOTH(TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_WESTERN_CHARSET) #if ALL(FTDI_EXTENDED, TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_WESTERN_CHARSET)
#include "western_char_set_bitmap_31.h" #include "western_char_set_bitmap_31.h"
@ -45,81 +45,81 @@
DOT_ABOVE, DOT_ABOVE,
CEDILLA, CEDILLA,
NO_DOT_I, NO_DOT_I,
#if ENABLED(TOUCH_UI_UTF8_GERMANIC) #if ENABLED(TOUCH_UI_UTF8_GERMANIC)
SHARP_S, SHARP_S,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
LRG_O_STROKE, LRG_O_STROKE,
SML_O_STROKE, SML_O_STROKE,
LRG_AE, LRG_AE,
SML_AE, SML_AE,
LRG_ETH, LRG_ETH,
SML_ETH, SML_ETH,
LRG_THORN, LRG_THORN,
SML_THORN, SML_THORN,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) #if ENABLED(TOUCH_UI_UTF8_PUNCTUATION)
LEFT_DBL_QUOTE, LEFT_DBL_QUOTE,
RIGHT_DBL_QUOTE, RIGHT_DBL_QUOTE,
INV_EXCLAMATION, INV_EXCLAMATION,
INV_QUESTION, INV_QUESTION,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_CURRENCY) #if ENABLED(TOUCH_UI_UTF8_CURRENCY)
CENT_SIGN, CENT_SIGN,
POUND_SIGN, POUND_SIGN,
CURRENCY_SIGN, CURRENCY_SIGN,
YEN_SIGN, YEN_SIGN,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
SUPERSCRIPT_ONE, SUPERSCRIPT_ONE,
SUPERSCRIPT_TWO, SUPERSCRIPT_TWO,
SUPERSCRIPT_THREE, SUPERSCRIPT_THREE,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_ORDINALS) #if ENABLED(TOUCH_UI_UTF8_ORDINALS)
MASCULINE_ORDINAL, MASCULINE_ORDINAL,
FEMININE_ORDINAL, FEMININE_ORDINAL,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) #if ENABLED(TOUCH_UI_UTF8_COPYRIGHT)
COPYRIGHT_SIGN, COPYRIGHT_SIGN,
REGISTERED_SIGN, REGISTERED_SIGN,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) #if ENABLED(TOUCH_UI_UTF8_MATHEMATICS)
PLUS_MINUS_SIGN, PLUS_MINUS_SIGN,
MULTIPLICATION_SIGN, MULTIPLICATION_SIGN,
DIVISION_SIGN, DIVISION_SIGN,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) #if ENABLED(TOUCH_UI_UTF8_FRACTIONS)
FRACTION_QUARTER, FRACTION_QUARTER,
FRACTION_HALF, FRACTION_HALF,
FRACTION_THREE_FOURTHS, FRACTION_THREE_FOURTHS,
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) #if ENABLED(TOUCH_UI_UTF8_SYMBOLS)
MICRON_SIGN, MICRON_SIGN,
PILCROW_SIGN, PILCROW_SIGN,
BROKEN_BAR, BROKEN_BAR,
SECTION_SIGN, SECTION_SIGN,
NOT_SIGN NOT_SIGN
#endif #endif
}; };
/* Centerline of characters that can take accents */ /* Centerline of characters that can take accents */
constexpr int8_t mid_a = 12; constexpr int8_t mid_a = 12,
constexpr int8_t mid_e = 12; mid_e = 12,
constexpr int8_t mid_i = 5; mid_i = 5,
constexpr int8_t mid_o = 12; mid_o = 12,
constexpr int8_t mid_u = 12; mid_u = 12,
constexpr int8_t mid_y = 11; mid_y = 11,
constexpr int8_t mid_n = 12; mid_n = 12,
constexpr int8_t mid_c = 12; mid_c = 12,
constexpr int8_t mid_A = 13; mid_A = 13,
constexpr int8_t mid_E = 13; mid_E = 13,
constexpr int8_t mid_I = 6; mid_I = 6,
constexpr int8_t mid_O = 14; mid_O = 14,
constexpr int8_t mid_U = 14; mid_U = 14,
constexpr int8_t mid_Y = 13; mid_Y = 13,
constexpr int8_t mid_N = 15; mid_N = 15,
constexpr int8_t mid_C = 13; mid_C = 13;
/* Centerline of accent glyphs */ /* Centerline of accent glyphs */
@ -144,148 +144,148 @@
uint8_t alt_data; // For accented characters, the centerline; else char width uint8_t alt_data; // For accented characters, the centerline; else char width
} char_recipe[] = { } char_recipe[] = {
{0, 0, NO_DOT_I, 10 }, {0, 0, NO_DOT_I, 10 },
#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) #if ENABLED(TOUCH_UI_UTF8_PUNCTUATION)
{UTF8('¡'), 0 , INV_EXCLAMATION, 13 }, {UTF8('¡'), 0 , INV_EXCLAMATION, 13 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_CURRENCY) #if ENABLED(TOUCH_UI_UTF8_CURRENCY)
{UTF8('¢'), 0 , CENT_SIGN, 23 }, {UTF8('¢'), 0 , CENT_SIGN, 23 },
{UTF8('£'), 0 , POUND_SIGN, 24 }, {UTF8('£'), 0 , POUND_SIGN, 24 },
{UTF8('¤'), 0 , CURRENCY_SIGN, 26 }, {UTF8('¤'), 0 , CURRENCY_SIGN, 26 },
{UTF8('¥'), 0 , YEN_SIGN, 26 }, {UTF8('¥'), 0 , YEN_SIGN, 26 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) #if ENABLED(TOUCH_UI_UTF8_SYMBOLS)
{UTF8('¦'), 0 , BROKEN_BAR, 11 }, {UTF8('¦'), 0 , BROKEN_BAR, 11 },
{UTF8('§'), 0 , SECTION_SIGN, 21 }, {UTF8('§'), 0 , SECTION_SIGN, 21 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) #if ENABLED(TOUCH_UI_UTF8_COPYRIGHT)
{UTF8('©'), 0 , COPYRIGHT_SIGN, 38 }, {UTF8('©'), 0 , COPYRIGHT_SIGN, 38 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_ORDINALS) #if ENABLED(TOUCH_UI_UTF8_ORDINALS)
{UTF8('ª'), 0 , FEMININE_ORDINAL, 19 }, {UTF8('ª'), 0 , FEMININE_ORDINAL, 19 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) #if ENABLED(TOUCH_UI_UTF8_PUNCTUATION)
{UTF8('«'), 0 , LEFT_DBL_QUOTE, 23 }, {UTF8('«'), 0 , LEFT_DBL_QUOTE, 23 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) #if ENABLED(TOUCH_UI_UTF8_SYMBOLS)
{UTF8('¬'), 0 , NOT_SIGN, 32 }, {UTF8('¬'), 0 , NOT_SIGN, 32 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) #if ENABLED(TOUCH_UI_UTF8_COPYRIGHT)
{UTF8('®'), 0 , REGISTERED_SIGN, 38 }, {UTF8('®'), 0 , REGISTERED_SIGN, 38 },
#endif #endif
{UTF8('°'), 0 , DOT_ABOVE, 24 }, {UTF8('°'), 0 , DOT_ABOVE, 24 },
#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) #if ENABLED(TOUCH_UI_UTF8_MATHEMATICS)
{UTF8('±'), 0 , NOT_SIGN, 32 }, {UTF8('±'), 0 , NOT_SIGN, 32 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
{UTF8('²'), 0 , SUPERSCRIPT_TWO, 16 }, {UTF8('²'), 0 , SUPERSCRIPT_TWO, 16 },
{UTF8('³'), 0 , SUPERSCRIPT_THREE, 16 }, {UTF8('³'), 0 , SUPERSCRIPT_THREE, 16 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) #if ENABLED(TOUCH_UI_UTF8_SYMBOLS)
{UTF8('µ'), 0 , MICRON_SIGN, 28 }, {UTF8('µ'), 0 , MICRON_SIGN, 28 },
{UTF8(''), 0 , PILCROW_SIGN, 24 }, {UTF8(''), 0 , PILCROW_SIGN, 24 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS)
{UTF8('¹'), 0 , SUPERSCRIPT_ONE, 16 }, {UTF8('¹'), 0 , SUPERSCRIPT_ONE, 16 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_ORDINALS) #if ENABLED(TOUCH_UI_UTF8_ORDINALS)
{UTF8('º'), 0 , MASCULINE_ORDINAL, 19 }, {UTF8('º'), 0 , MASCULINE_ORDINAL, 19 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) #if ENABLED(TOUCH_UI_UTF8_PUNCTUATION)
{UTF8('»'), 0 , RIGHT_DBL_QUOTE, 24 }, {UTF8('»'), 0 , RIGHT_DBL_QUOTE, 24 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) #if ENABLED(TOUCH_UI_UTF8_FRACTIONS)
{UTF8('¼'), 0 , FRACTION_QUARTER, 40 }, {UTF8('¼'), 0 , FRACTION_QUARTER, 40 },
{UTF8('½'), 0 , FRACTION_HALF, 40 }, {UTF8('½'), 0 , FRACTION_HALF, 40 },
{UTF8('¾'), 0 , FRACTION_THREE_FOURTHS, 40 }, {UTF8('¾'), 0 , FRACTION_THREE_FOURTHS, 40 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) #if ENABLED(TOUCH_UI_UTF8_PUNCTUATION)
{UTF8('¿'), 0 , INV_QUESTION, 21 }, {UTF8('¿'), 0 , INV_QUESTION, 21 },
#endif #endif
{UTF8('À'), 'A', GRAVE, mid_A}, {UTF8('À'), 'A', GRAVE, mid_A},
{UTF8('Á'), 'A', ACUTE, mid_A}, {UTF8('Á'), 'A', ACUTE, mid_A},
{UTF8('Â'), 'A', CIRCUMFLEX, mid_A}, {UTF8('Â'), 'A', CIRCUMFLEX, mid_A},
{UTF8('Ã'), 'A', TILDE, mid_A}, {UTF8('Ã'), 'A', TILDE, mid_A},
{UTF8('Ä'), 'A', DIAERESIS, mid_A}, {UTF8('Ä'), 'A', DIAERESIS, mid_A},
{UTF8('Å'), 'A', DOT_ABOVE, mid_A}, {UTF8('Å'), 'A', DOT_ABOVE, mid_A},
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('Æ'), 0 , LRG_AE, 40}, {UTF8('Æ'), 0 , LRG_AE, 40},
#endif #endif
{UTF8('Ç'), 'C', CEDILLA, mid_C}, {UTF8('Ç'), 'C', CEDILLA, mid_C},
{UTF8('È'), 'E', GRAVE, mid_E}, {UTF8('È'), 'E', GRAVE, mid_E},
{UTF8('É'), 'E', ACUTE, mid_E}, {UTF8('É'), 'E', ACUTE, mid_E},
{UTF8('Ê'), 'E', CIRCUMFLEX, mid_E}, {UTF8('Ê'), 'E', CIRCUMFLEX, mid_E},
{UTF8('Ë'), 'E', DIAERESIS, mid_E}, {UTF8('Ë'), 'E', DIAERESIS, mid_E},
{UTF8('Ì'), 'I', GRAVE, mid_I}, {UTF8('Ì'), 'I', GRAVE, mid_I},
{UTF8('Í'), 'I', ACUTE, mid_I}, {UTF8('Í'), 'I', ACUTE, mid_I},
{UTF8('Î'), 'I', CIRCUMFLEX, mid_I}, {UTF8('Î'), 'I', CIRCUMFLEX, mid_I},
{UTF8('Ï'), 'I', DIAERESIS, mid_I}, {UTF8('Ï'), 'I', DIAERESIS, mid_I},
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('Ð'), 0, LRG_ETH, 31 }, {UTF8('Ð'), 0, LRG_ETH, 31 },
#endif #endif
{UTF8('Ñ'), 'N', TILDE, mid_N}, {UTF8('Ñ'), 'N', TILDE, mid_N},
{UTF8('Ò'), 'O', GRAVE, mid_O}, {UTF8('Ò'), 'O', GRAVE, mid_O},
{UTF8('Ó'), 'O', ACUTE, mid_O}, {UTF8('Ó'), 'O', ACUTE, mid_O},
{UTF8('Ô'), 'O', CIRCUMFLEX, mid_O}, {UTF8('Ô'), 'O', CIRCUMFLEX, mid_O},
{UTF8('Õ'), 'O', TILDE, mid_O}, {UTF8('Õ'), 'O', TILDE, mid_O},
{UTF8('Ö'), 'O', DIAERESIS, mid_O}, {UTF8('Ö'), 'O', DIAERESIS, mid_O},
#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) #if ENABLED(TOUCH_UI_UTF8_MATHEMATICS)
{UTF8('×'), 0 , MULTIPLICATION_SIGN, 32 }, {UTF8('×'), 0 , MULTIPLICATION_SIGN, 32 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('Ø'), 0 , LRG_O_STROKE, 32 }, {UTF8('Ø'), 0 , LRG_O_STROKE, 32 },
#endif #endif
{UTF8('Ù'), 'U', GRAVE, mid_U}, {UTF8('Ù'), 'U', GRAVE, mid_U},
{UTF8('Ú'), 'U', ACUTE, mid_U}, {UTF8('Ú'), 'U', ACUTE, mid_U},
{UTF8('Û'), 'U', CIRCUMFLEX, mid_U}, {UTF8('Û'), 'U', CIRCUMFLEX, mid_U},
{UTF8('Ü'), 'U', DIAERESIS, mid_U}, {UTF8('Ü'), 'U', DIAERESIS, mid_U},
{UTF8('Ý'), 'Y', ACUTE, mid_Y}, {UTF8('Ý'), 'Y', ACUTE, mid_Y},
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('Þ'), 0 , LRG_THORN, 25 }, {UTF8('Þ'), 0 , LRG_THORN, 25 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_GERMANIC) #if ENABLED(TOUCH_UI_UTF8_GERMANIC)
{UTF8('ß'), 0 , SHARP_S, 26 }, {UTF8('ß'), 0 , SHARP_S, 26 },
#endif #endif
{UTF8('à'), 'a', GRAVE, mid_a}, {UTF8('à'), 'a', GRAVE, mid_a},
{UTF8('á'), 'a', ACUTE, mid_a}, {UTF8('á'), 'a', ACUTE, mid_a},
{UTF8('â'), 'a', CIRCUMFLEX, mid_a}, {UTF8('â'), 'a', CIRCUMFLEX, mid_a},
{UTF8('ã'), 'a', TILDE, mid_a}, {UTF8('ã'), 'a', TILDE, mid_a},
{UTF8('ä'), 'a', DIAERESIS, mid_a}, {UTF8('ä'), 'a', DIAERESIS, mid_a},
{UTF8('å'), 'a', DOT_ABOVE, mid_a}, {UTF8('å'), 'a', DOT_ABOVE, mid_a},
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('æ'), 0 , SML_AE, 40 }, {UTF8('æ'), 0 , SML_AE, 40 },
#endif #endif
{UTF8('ç'), 'c', CEDILLA, mid_c}, {UTF8('ç'), 'c', CEDILLA, mid_c},
{UTF8('è'), 'e', GRAVE, mid_e}, {UTF8('è'), 'e', GRAVE, mid_e},
{UTF8('é'), 'e', ACUTE, mid_e}, {UTF8('é'), 'e', ACUTE, mid_e},
{UTF8('ê'), 'e', CIRCUMFLEX, mid_e}, {UTF8('ê'), 'e', CIRCUMFLEX, mid_e},
{UTF8('ë'), 'e', DIAERESIS, mid_e}, {UTF8('ë'), 'e', DIAERESIS, mid_e},
{UTF8('ì'), 'i', GRAVE, mid_i}, {UTF8('ì'), 'i', GRAVE, mid_i},
{UTF8('í'), 'i', ACUTE, mid_i}, {UTF8('í'), 'i', ACUTE, mid_i},
{UTF8('î'), 'i', CIRCUMFLEX, mid_i}, {UTF8('î'), 'i', CIRCUMFLEX, mid_i},
{UTF8('ï'), 'i', DIAERESIS, mid_i}, {UTF8('ï'), 'i', DIAERESIS, mid_i},
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('ð'), 0, SML_ETH, 24 }, {UTF8('ð'), 0, SML_ETH, 24 },
#endif #endif
{UTF8('ñ'), 'n', TILDE, mid_n}, {UTF8('ñ'), 'n', TILDE, mid_n},
{UTF8('ò'), 'o', GRAVE, mid_o}, {UTF8('ò'), 'o', GRAVE, mid_o},
{UTF8('ó'), 'o', ACUTE, mid_o}, {UTF8('ó'), 'o', ACUTE, mid_o},
{UTF8('ô'), 'o', CIRCUMFLEX, mid_o}, {UTF8('ô'), 'o', CIRCUMFLEX, mid_o},
{UTF8('õ'), 'o', TILDE, mid_o}, {UTF8('õ'), 'o', TILDE, mid_o},
{UTF8('ö'), 'o', DIAERESIS, mid_o}, {UTF8('ö'), 'o', DIAERESIS, mid_o},
#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) #if ENABLED(TOUCH_UI_UTF8_MATHEMATICS)
{UTF8('÷'), 0 , DIVISION_SIGN, 32 }, {UTF8('÷'), 0 , DIVISION_SIGN, 32 },
#endif #endif
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('ø'), 0 , SML_O_STROKE, 25 }, {UTF8('ø'), 0 , SML_O_STROKE, 25 },
#endif #endif
{UTF8('ù'), 'u', GRAVE, mid_u}, {UTF8('ù'), 'u', GRAVE, mid_u},
{UTF8('ú'), 'u', ACUTE, mid_u}, {UTF8('ú'), 'u', ACUTE, mid_u},
{UTF8('û'), 'u', CIRCUMFLEX, mid_u}, {UTF8('û'), 'u', CIRCUMFLEX, mid_u},
{UTF8('ü'), 'u', DIAERESIS, mid_u}, {UTF8('ü'), 'u', DIAERESIS, mid_u},
{UTF8('ý'), 'y', ACUTE, mid_y}, {UTF8('ý'), 'y', ACUTE, mid_y},
#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN)
{UTF8('þ'), 0 , SML_THORN, 25 }, {UTF8('þ'), 0 , SML_THORN, 25 },
#endif #endif
{UTF8('ÿ'), 'y', DIAERESIS, mid_y} {UTF8('ÿ'), 'y', DIAERESIS, mid_y}
}; };
@ -424,7 +424,8 @@
accent_char = 0; accent_char = 0;
if (c == UTF8('°')) if (c == UTF8('°'))
x -= fs.scale(deg_sign_leading); x -= fs.scale(deg_sign_leading);
} else { }
else {
// Regular character with accent: // Regular character with accent:
accent_dx = alt_data - mid_accent; accent_dx = alt_data - mid_accent;
accent_dy = isupper(std_char) ? -7 : 0; accent_dy = isupper(std_char) ? -7 : 0;

View File

@ -92,7 +92,8 @@ class PolyReader {
close_loop(); close_loop();
else else
p = NULL; p = NULL;
} else { }
else {
x = pgm_read_word_far(p++); x = pgm_read_word_far(p++);
if (x == eol) if (x == eol)
close_loop(); close_loop();
@ -225,7 +226,8 @@ class DeduplicatedPolyReader : public POLY_READER {
} while (POLY_READER::x == last_x && POLY_READER::y == last_y && !POLY_READER::end_of_loop()); } while (POLY_READER::x == last_x && POLY_READER::y == last_y && !POLY_READER::end_of_loop());
if (POLY_READER::end_of_loop()) { if (POLY_READER::end_of_loop()) {
last_x = last_y = eol; last_x = last_y = eol;
} else { }
else {
last_x = POLY_READER::x; last_x = POLY_READER::x;
last_y = POLY_READER::y; last_y = POLY_READER::y;
} }

View File

@ -73,13 +73,13 @@ void BaseNumericAdjustmentScreen::widgets_t::_button_style(CommandProcessor &cmd
const btn_colors *old_colors = &normal_btn; const btn_colors *old_colors = &normal_btn;
const btn_colors *new_colors = &normal_btn; const btn_colors *new_colors = &normal_btn;
switch(_style) { switch (_style) {
case BTN_ACTION: old_colors = &action_btn; break; case BTN_ACTION: old_colors = &action_btn; break;
case BTN_TOGGLE: old_colors = &ui_toggle; break; case BTN_TOGGLE: old_colors = &ui_toggle; break;
case BTN_DISABLED: old_colors = &disabled_btn; break; case BTN_DISABLED: old_colors = &disabled_btn; break;
default: break; default: break;
} }
switch(style) { switch (style) {
case BTN_ACTION: new_colors = &action_btn; break; case BTN_ACTION: new_colors = &action_btn; break;
case BTN_TOGGLE: new_colors = &ui_toggle; break; case BTN_TOGGLE: new_colors = &ui_toggle; break;
case BTN_DISABLED: new_colors = &disabled_btn; break; case BTN_DISABLED: new_colors = &disabled_btn; break;

View File

@ -102,12 +102,11 @@ bool BioPrintingDialogBox::onTouchEnd(uint8_t tag) {
case 1: GOTO_SCREEN(FeedratePercentScreen); break; case 1: GOTO_SCREEN(FeedratePercentScreen); break;
case 2: GOTO_SCREEN(TuneMenu); break; case 2: GOTO_SCREEN(TuneMenu); break;
case 3: case 3:
if (isPrinting()) { if (isPrinting())
GOTO_SCREEN(ConfirmAbortPrintDialogBox); GOTO_SCREEN(ConfirmAbortPrintDialogBox);
} else { else
GOTO_SCREEN(StatusScreen); GOTO_SCREEN(StatusScreen);
} break;
break;
default: return false; default: return false;
} }
return true; return true;
@ -136,9 +135,8 @@ void BioPrintingDialogBox::setStatusMessage(const char* message) {
SERIAL_ECHOLNPAIR("New status message: ", message); SERIAL_ECHOLNPAIR("New status message: ", message);
#endif #endif
if (AT_SCREEN(BioPrintingDialogBox)) { if (AT_SCREEN(BioPrintingDialogBox))
current_screen.onRefresh(); current_screen.onRefresh();
}
} }
void BioPrintingDialogBox::onIdle() { void BioPrintingDialogBox::onIdle() {

View File

@ -114,7 +114,8 @@ void FilesScreen::drawFileList() {
for(uint8_t i = 0; i < files_per_page; i++, fileIndex++) { for(uint8_t i = 0; i < files_per_page; i++, fileIndex++) {
if (files.seek(fileIndex)) { if (files.seek(fileIndex)) {
drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false); drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false);
} else { }
else {
break; break;
} }
} }

View File

@ -72,19 +72,11 @@ void LockScreen::onRedraw(draw_mode_t what) {
message = GET_TEXT_F(MSG_PASSCODE_ACCEPTED); message = GET_TEXT_F(MSG_PASSCODE_ACCEPTED);
break; break;
default: default:
if (passcode == 0) { message = passcode ? GET_TEXT_F(MSG_PASSCODE_REQUEST) : GET_TEXT_F(MSG_PASSCODE_SELECT);
message = GET_TEXT_F(MSG_PASSCODE_SELECT);
} else {
message = GET_TEXT_F(MSG_PASSCODE_REQUEST);
}
} }
message_style() = '\0'; // Terminate the string. message_style() = '\0'; // Terminate the string.
#ifdef TOUCH_UI_PORTRAIT constexpr uint8_t l = TERN(TOUCH_UI_PORTRAIT, 6, 3);
constexpr uint8_t l = 6;
#else
constexpr uint8_t l = 3;
#endif
const uint8_t pressed = EventLoop::get_pressed_tag(); const uint8_t pressed = EventLoop::get_pressed_tag();
@ -144,7 +136,8 @@ void LockScreen::onPasscodeEntered() {
onRefresh(); onRefresh();
sound.play(twinkle, PLAY_SYNCHRONOUS); sound.play(twinkle, PLAY_SYNCHRONOUS);
GOTO_PREVIOUS(); GOTO_PREVIOUS();
} else { }
else {
message_style() = 'w'; message_style() = 'w';
onRefresh(); onRefresh();
sound.play(sad_trombone, PLAY_SYNCHRONOUS); sound.play(sad_trombone, PLAY_SYNCHRONOUS);
@ -162,7 +155,8 @@ bool LockScreen::onTouchEnd(uint8_t tag) {
// Backspace deletes previous entered characters. // Backspace deletes previous entered characters.
*--c = '_'; *--c = '_';
} }
} else { }
else {
// Append character to passcode // Append character to passcode
*c++ = tag; *c++ = tag;
if (*c == '\0') { if (*c == '\0') {

View File

@ -380,7 +380,8 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
case 4: case 4:
if (isPrinting()) { if (isPrinting()) {
GOTO_SCREEN(TuneMenu); GOTO_SCREEN(TuneMenu);
} else { }
else {
GOTO_SCREEN(MainMenu); GOTO_SCREEN(MainMenu);
} }
break; break;
@ -394,7 +395,8 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
#else #else
return false; return false;
#endif #endif
} else { }
else {
GOTO_SCREEN(MoveAxisScreen); GOTO_SCREEN(MoveAxisScreen);
} }
break; break;

View File

@ -123,7 +123,8 @@ void StressTestScreen::onIdle() {
if (!isPositionKnown()) { if (!isPositionKnown()) {
extern const char G28_STR[]; extern const char G28_STR[];
injectCommands_P(G28_STR); injectCommands_P(G28_STR);
} else { }
else {
injectCommands_P(PSTR( injectCommands_P(PSTR(
"G0 X100 Y100 Z100 F6000\n" "G0 X100 Y100 Z100 F6000\n"
"T0\nG4 S1" "T0\nG4 S1"