From fa89a7b0bc1051c9133dd748e16127a50c8b190e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Dec 2020 15:33:34 -0600 Subject: [PATCH] Apply ENABLED in ExiUI / FTDI --- .../ftdi_eve_lib/basic/resolutions.h | 2 +- .../extended/command_processor.cpp | 2 +- .../ftdi_eve_lib/extended/command_processor.h | 10 +++---- .../ftdi_eve_lib/extended/dl_cache.cpp | 2 +- .../ftdi_eve_lib/extended/event_loop.cpp | 2 +- .../ftdi_eve_lib/extended/ftdi_extended.h | 2 +- .../ftdi_eve_lib/extended/grid_layout.h | 2 +- .../ftdi_eve_lib/extended/polygon.h | 2 +- .../ftdi_eve_lib/extended/screen_types.cpp | 2 +- .../ftdi_eve_lib/extended/screen_types.h | 6 ++-- .../ftdi_eve_lib/extended/sound_player.cpp | 2 +- .../ftdi_eve_lib/extended/text_box.cpp | 4 +-- .../ftdi_eve_lib/extended/text_ellipsis.cpp | 4 +-- .../ftdi_eve_lib/extended/tiny_timer.cpp | 14 ++------- .../extended/unicode/font_bitmaps.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/unicode.h | 10 +++---- .../ftdi_eve_touch_ui/language/language_en.h | 2 +- .../screens/advanced_settings_menu.cpp | 2 +- .../base_numeric_adjustment_screen.cpp | 18 +++++------ .../screens/bed_mesh_screen.cpp | 2 +- .../screens/bio_status_screen.cpp | 10 +++---- .../ftdi_eve_touch_ui/screens/boot_screen.cpp | 8 ++--- .../screens/change_filament_screen.cpp | 16 +++++----- .../screens/cocoa_press_status_screen.cpp | 4 +-- .../screens/custom_user_menus.cpp | 2 +- .../screens/developer_menu.cpp | 2 +- .../screens/endstop_state_screen.cpp | 2 +- .../screens/filament_menu.cpp | 2 +- .../screens/files_screen.cpp | 4 +-- .../screens/interface_settings_screen.cpp | 6 ++-- .../screens/interface_sounds_screen.cpp | 2 +- .../screens/leveling_menu.cpp | 2 +- .../ftdi_eve_touch_ui/screens/lock_screen.cpp | 4 +-- .../ftdi_eve_touch_ui/screens/main_menu.cpp | 30 +++---------------- .../lib/ftdi_eve_touch_ui/screens/screens.cpp | 22 -------------- .../lib/ftdi_eve_touch_ui/screens/screens.h | 24 +-------------- .../screens/status_screen.cpp | 10 +++---- .../screens/temperature_screen.cpp | 2 +- .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 2 +- .../screens/widget_demo_screen.cpp | 4 +-- .../extui/lib/ftdi_eve_touch_ui/theme/fonts.h | 6 ++-- 41 files changed, 91 insertions(+), 165 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h index d90fc1e8f0..5b29816429 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h @@ -45,7 +45,7 @@ static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \ static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv"); -#ifdef TOUCH_UI_320x240 +#if ENABLED(TOUCH_UI_320x240) namespace FTDI { constexpr uint8_t Pclk = 8; constexpr uint8_t Pclkpol = 0; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp index a7777a97fe..e324cb978a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func; bool CommandProcessor::is_tracking = false; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h index b27ed7f59e..da51ee6385 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -312,12 +312,12 @@ class CommandProcessor : public CLCD::CommandFifo { int8_t apply_fit_text(int16_t w, int16_t h, T text) { using namespace FTDI; int8_t font = _font; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) const bool is_utf8 = has_utf8_chars(text); #endif for (;font > 26;) { int16_t width, height; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (is_utf8) { width = get_utf8_text_width(text, font_size_t::from_romfont(font)); height = font_size_t::from_romfont(font).get_height(); @@ -345,7 +345,7 @@ class CommandProcessor : public CLCD::CommandFifo { template uint16_t text_width(T text) { using namespace FTDI; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(text)) return get_utf8_text_width(text, font_size_t::from_romfont(_font)); #endif @@ -362,7 +362,7 @@ class CommandProcessor : public CLCD::CommandFifo { #else const int8_t font = _font; #endif - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(text)) draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), options); else @@ -401,7 +401,7 @@ class CommandProcessor : public CLCD::CommandFifo { const int8_t font = _font; #endif CLCD::CommandFifo::button(x, y, w, h, font, options); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(text)) { CLCD::CommandFifo::str(F("")); apply_text_alignment(x, y, w, h, OPT_CENTER); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp index 9f2b6dd35f..a13c36265e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -22,7 +22,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) /* The Display List Cache mechanism stores the display list corresponding * to a menu into RAM_G so that on subsequent calls drawing the menu does diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp index 0808f2f4f2..6c0392c200 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp @@ -22,7 +22,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) using namespace FTDI; enum { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h index 505016f5b8..fd84c795f1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h @@ -29,7 +29,7 @@ #define FTDI_EXTENDED #endif -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) #include "unicode/font_size_t.h" #include "unicode/unicode.h" #include "unicode/standard_char_set.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h index 490cbd4e54..82bb8abf7f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h @@ -88,7 +88,7 @@ } namespace FTDI { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr uint16_t display_width = Vsize; constexpr uint16_t display_height = Hsize; #else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h index 202c3cd7fb..6aa52f09c9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h @@ -66,7 +66,7 @@ namespace FTDI { cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); // Drawing the edge strip along scan lines // seems to yield the best performance - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) path_initiator = EDGE_STRIP_B; #else path_initiator = EDGE_STRIP_R; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp index 81a081faae..944237bd28 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) /********************** VIRTUAL DISPATCH DATA TYPE ******************************/ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h index ef92361498..1581cbbbc7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h @@ -158,7 +158,7 @@ class UncachedScreen { using namespace FTDI; CommandProcessor cmd; cmd.cmd(CMD_DLSTART); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); #endif @@ -199,7 +199,7 @@ class CachedScreen { CommandProcessor cmd; cmd.cmd(CMD_DLSTART); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); #endif current_screen.onRedraw(BACKGROUND); @@ -222,7 +222,7 @@ class CachedScreen { dlcache.append(); } else { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); #endif current_screen.onRedraw(BACKGROUND); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp index 481589854b..f9869320ba 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { SoundPlayer sound; // Global sound player object diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp index 18e5d4bc5b..b7422a06b1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { /** @@ -103,7 +103,7 @@ namespace FTDI { if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ') line[line_len - 1] = 0; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(line)) { draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY); } else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp index cdec6e5dd2..5fc89f1fa9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { @@ -60,7 +60,7 @@ namespace FTDI { } cmd.apply_text_alignment(x, y, w, h, options); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(str)) { draw_utf8_text(cmd, x, y, str, font_size_t::from_romfont(font), options); } else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp index 2147dd7c8f..5219c0d041 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp @@ -21,15 +21,11 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) bool tiny_timer_t::elapsed(tiny_time_t duration) { uint8_t now = tiny_time_t::tiny_time( - #ifdef __MARLIN_FIRMWARE__ - ExtUI::safe_millis() - #else - millis() - #endif + TERN(__MARLIN_FIRMWARE__, ExtUI::safe_millis(), millis()) ); uint8_t elapsed = now - _start; return elapsed >= duration._duration; @@ -37,11 +33,7 @@ bool tiny_timer_t::elapsed(tiny_time_t duration) { void tiny_timer_t::start() { _start = tiny_time_t::tiny_time( - #ifdef __MARLIN_FIRMWARE__ - ExtUI::safe_millis() - #else - millis() - #endif + TERN(__MARLIN_FIRMWARE__, ExtUI::safe_millis(), millis()) ); } #endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp index d04fe7d5b6..d9acb4f67a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -21,7 +21,7 @@ #include "../ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index b615c812eb..5bb87d9684 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -24,7 +24,7 @@ class CommandProcessor; namespace FTDI { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) typedef uint16_t utf8_char_t; /** @@ -75,14 +75,14 @@ namespace FTDI { // Similar to CLCD::FontMetrics, but can be used with UTF8 encoded strings. struct FontMetrics { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) font_size_t fs; #else CLCD::FontMetrics fm; #endif inline void load(uint8_t rom_font_size) { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) fs = font_size_t::from_romfont(rom_font_size); #else fm.load(rom_font_size); @@ -90,7 +90,7 @@ namespace FTDI { } inline uint16_t get_char_width(utf8_char_t c) const { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) return get_utf8_char_width(c, fs); #else return fm.char_widths[(uint8_t)c]; @@ -98,7 +98,7 @@ namespace FTDI { } inline uint8_t get_height() const { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) return fs.get_height(); #else return fm.height; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h index 09ac965e49..c898e7b737 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -146,7 +146,7 @@ namespace Language_en { PROGMEM Language_Str MSG_LEVELING = u8"Leveling"; PROGMEM Language_Str MSG_SHOW_MESH = u8"Show Bed Mesh"; - #ifdef TOUCH_UI_LULZBOT_BIO + #if ENABLED(TOUCH_UI_LULZBOT_BIO) PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 0b2dc911f1..9036fc144b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -37,7 +37,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)); } - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #if EITHER(HAS_MULTI_HOTEND, SENSORLESS_HOMING) #define GRID_ROWS 9 #else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp index a118d851df..2d11f6948f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 13 #define GRID_ROWS 10 #define LAYOUT_FONT font_small @@ -53,7 +53,7 @@ BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what cmd.font(font_medium); _button(cmd, 1, - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1,10), BTN_SIZE(13,1), #else BTN_POS(15,7), BTN_SIZE(4,1), @@ -129,7 +129,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { cmd.font(font_medium) .tag(0) .text( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1, _line), BTN_SIZE(12,1), #else BTN_POS(5, _line), BTN_SIZE(8,1), @@ -141,7 +141,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { _line++; } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #ifdef TOUCH_UI_800x480 #undef EDGE_R #define EDGE_R 20 @@ -172,7 +172,7 @@ void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcesso const bool highlight = (_what & FOREGROUND) && (increment == tag); switch (pos) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; @@ -192,7 +192,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() { if (_what & BACKGROUND) { _button_style(cmd, TEXT_LABEL); cmd.tag(0).text( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1, _line), BTN_SIZE(4,1), #else BTN_POS(15, 1), BTN_SIZE(4,1), @@ -205,7 +205,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() { _draw_increment_btn(cmd, _line+1, 244 - _decimals); _draw_increment_btn(cmd, _line+1, 243 - _decimals); - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) _line++; #endif } @@ -308,7 +308,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab _button_style(cmd, TEXT_LABEL); cmd.font(font_small) .text( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1, _line), BTN_SIZE( 8,1), #else BTN_POS(1, _line), BTN_SIZE(10,1), @@ -323,7 +323,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab .enabled(is_enabled) .font(font_small) .toggle2( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS( 9,_line), BTN_SIZE(5,1), #else BTN_POS(10,_line), BTN_SIZE(4,1), diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp index dbc4ba3b4b..2ed602a809 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace Theme; using namespace ExtUI; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 2 #define GRID_ROWS 10 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp index c95d2d1dba..fc827e83e3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp @@ -73,7 +73,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { // The LulzBot Bio shows the temperature for // the bed. - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) // Draw touch surfaces ui.bounds(POLY(target_temp), x, y, h, v); cmd.rectangle(x, y, h, v); @@ -95,7 +95,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .cmd(COLOR_RGB(bg_text_enabled)) .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } @@ -105,7 +105,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { cmd.cmd(COLOR_RGB(bg_text_enabled)); cmd.font(font_medium); - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) format_temp(str, getTargetTemp_celsius(BED)); else @@ -204,7 +204,7 @@ void StatusScreen::draw_fine_motion(draw_mode_t what) { PolyUI ui(cmd, what); cmd.font( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) font_medium #else font_small @@ -273,7 +273,7 @@ void StatusScreen::loadBitmaps() { CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_data(base + UTF8_FONT_OFFSET); #endif } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp index 40e49672d4..a6a8705350 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp @@ -30,14 +30,14 @@ #include "../ftdi_eve_lib/extras/poly_ui.h" #include "../archim2-flash/flash_storage.h" -#ifdef SHOW_CUSTOM_BOOTSCREEN - #ifdef TOUCH_UI_PORTRAIT +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #if ENABLED(TOUCH_UI_PORTRAIT) #include "../theme/bootscreen_logo_portrait.h" #else #include "../theme/_bootscreen_landscape.h" #endif #else - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #include "../theme/marlin_bootscreen_portrait.h" #else #include "../theme/marlin_bootscreen_landscape.h" @@ -92,7 +92,7 @@ void BootScreen::onIdle() { StatusScreen::loadBitmaps(); - #ifdef TOUCH_UI_LULZBOT_BIO + #if ENABLED(TOUCH_UI_LULZBOT_BIO) GOTO_SCREEN(BioConfirmHomeXYZ); current_screen.forget(); PUSH_SCREEN(StatusScreen); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp index 3f85fc9320..8f073365ff 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -101,7 +101,7 @@ void ChangeFilamentScreen::onExit() { void ChangeFilamentScreen::onRedraw(draw_mode_t what) { CommandProcessor cmd; - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 2 #define GRID_ROWS 11 #else @@ -114,13 +114,13 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) .tag(0) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .font(font_large) #else .font(font_medium) #endif .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION)) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .text(BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) #else .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) @@ -142,14 +142,14 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); cmd.cmd(COLOR_RGB(tcol)) .tag(15) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .rectangle(BTN_POS(2,7), BTN_SIZE(1,1)) #else .rectangle(BTN_POS(3,2), BTN_SIZE(2,1)) #endif .cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF)) .font(font_medium) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .text(BTN_POS(2,7), BTN_SIZE(1,1), e_str) #else .text(BTN_POS(3,2), BTN_SIZE(2,1), e_str) @@ -177,7 +177,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; #endif - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) cmd.font(font_large) #else cmd.font(font_medium) @@ -198,7 +198,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { cmd.font( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) font_large #else font_small @@ -227,7 +227,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { .cmd(COLOR_MASK(1,1,1,1)) .cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .font(font_large) .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp index e3310abaa7..d9881d747a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp @@ -45,7 +45,7 @@ void StatusScreen::loadBitmaps() { constexpr uint32_t base = ftdi_memory_map::RAM_G; // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_data(base + UTF8_FONT_OFFSET); #endif } @@ -111,7 +111,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { ui.bounds(POLY(h3_label), x, y, h, v); cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp index 4132226977..20f90d5a41 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp @@ -57,7 +57,7 @@ void CustomUserMenus::onRedraw(draw_mode_t what) { #define _MORE_THAN_TEN 0 #endif - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 11 #define GRID_COLS (1 + _MORE_THAN_TEN) #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp index 89a7e1edf7..9df060a6c4 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp @@ -52,7 +52,7 @@ void DeveloperMenu::onRedraw(draw_mode_t what) { #endif cmd.cmd(COLOR_RGB(bg_text_enabled)); - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 10 #define GRID_COLS 1 cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 864ba28623..a091197a87 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -53,7 +53,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); cmd.font( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) font_large #else font_medium diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp index dfdba33b08..f63fc416dd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 9 #define GRID_COLS 2 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index 7c0129610d..112d70c074 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -67,7 +67,7 @@ uint16_t FilesScreen::getFileForTag(uint8_t tag) { return screen_data.FilesScreen.cur_page * files_per_page + tag - 2; } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 6 #define GRID_ROWS (files_per_page + header_h + footer_h) #else @@ -151,7 +151,7 @@ void FilesScreen::drawHeader() { void FilesScreen::drawFooter() { #undef MARGIN_T #undef MARGIN_B - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define MARGIN_T 15 #define MARGIN_B 5 #else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp index 3f0e25f734..f0c6539bed 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp @@ -58,7 +58,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { #define GRID_COLS 4 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 7 #else #define GRID_ROWS 6 @@ -86,7 +86,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr uint8_t w = 2; #else constexpr uint8_t w = 1; @@ -106,7 +106,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { #endif #undef EDGE_R #define EDGE_R 0 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .colors(normal_btn) .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_SOUNDS)) .colors(action_btn) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp index 8fb813e79f..3e60639304 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp @@ -84,7 +84,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr uint8_t w = 2; #else constexpr uint8_t w = 1; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp index bf1e2d522e..53dd5f4fc5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp @@ -34,7 +34,7 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 9 #define GRID_COLS 2 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp index 193bb681ec..a3f2d09188 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp @@ -50,7 +50,7 @@ void LockScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 1 #define GRID_ROWS 10 #else @@ -81,7 +81,7 @@ void LockScreen::onRedraw(draw_mode_t what) { const uint8_t pressed = EventLoop::get_pressed_tag(); cmd.font(font_large) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .text(BTN_POS(1,2), BTN_SIZE(1,1), message) .font(font_xlarge) .text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.LockScreen.passcode) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 529daa2f83..146b799c20 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -1,25 +1,3 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - /***************** * main_menu.cpp * *****************/ @@ -59,7 +37,7 @@ void MainMenu::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)); } - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 8 #define GRID_COLS 2 #define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1) @@ -129,15 +107,15 @@ bool MainMenu::onTouchEnd(uint8_t tag) { case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; + case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; #endif case 4: GOTO_SCREEN(MoveAxisScreen); break; case 5: injectCommands_P(PSTR("M84")); break; case 6: GOTO_SCREEN(TemperatureScreen); break; case 7: GOTO_SCREEN(ChangeFilamentScreen); break; case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; - #ifdef HAS_LEVELING - case 9: GOTO_SCREEN(LevelingMenu); break; + #if HAS_LEVELING + case 9: GOTO_SCREEN(LevelingMenu); break; #endif case 10: GOTO_SCREEN(AboutScreen); break; #if ENABLED(CUSTOM_USER_MENUS) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp index 5b3f9a201f..5841c38f53 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -1,25 +1,3 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - /*************** * screens.cpp * ***************/ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 265d6eb486..4a2a407bd7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -1,25 +1,3 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - /************* * screens.h * *************/ @@ -767,7 +745,7 @@ class LockScreen : public BaseScreen, public CachedScreen { class FilesScreen : public BaseScreen, public CachedScreen { private: - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) static constexpr uint8_t header_h = 2; static constexpr uint8_t footer_h = 2; static constexpr uint8_t files_per_page = 11; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp index 61f59844c0..5764f46c82 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -32,7 +32,7 @@ using namespace FTDI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 8 #else #define GRID_ROWS 8 @@ -43,7 +43,7 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { #define GRID_COLS 3 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define X_LBL_POS BTN_POS(1,5), BTN_SIZE(1,1) #define Y_LBL_POS BTN_POS(1,6), BTN_SIZE(1,1) #define Z_LBL_POS BTN_POS(1,7), BTN_SIZE(1,1) @@ -111,7 +111,7 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { #undef GRID_COLS } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 8 #else #define GRID_COLS 12 @@ -164,7 +164,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .cmd (BITMAP_SIZE (Fan_Icon_Info)) .icon(ICON_POS(FAN_POS), Fan_Icon_Info, icon_scale); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } @@ -334,7 +334,7 @@ void StatusScreen::loadBitmaps() { CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_data(base + UTF8_FONT_OFFSET); #endif } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp index 0011306c7e..bdd434b5de 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp @@ -41,7 +41,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { w.heading(GET_TEXT_F(MSG_TEMPERATURE)); w.button(30, GET_TEXT_F(MSG_COOLDOWN)); #ifndef NO_TOOLHEAD_HEATER_GCODE - #ifdef TOUCH_UI_COCOA_PRESS + #if ENABLED(TOUCH_UI_COCOA_PRESS) w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); w.adjuster( 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1)); #if ENABLED(COCOA_PRESS_EXTRA_HEATER) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index f9df61bf6d..2fce402cf0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -38,7 +38,7 @@ void TuneMenu::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)); } - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 9 #define GRID_COLS 2 #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp index 6a9acbf8f1..96887102dc 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp @@ -51,7 +51,7 @@ void WidgetsScreen::onRedraw(draw_mode_t) { const uint16_t m = (slider_val*12*60/0xFFFFU)%60; const uint16_t s = (slider_val*12*60*60/0xFFFFU)%60; - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 3 #define GRID_ROWS 8 cmd.font(font_large) @@ -113,7 +113,7 @@ bool WidgetsScreen::onTouchStart(uint8_t tag) { CommandProcessor cmd; switch (tag) { case 1: GOTO_PREVIOUS(); break; - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,2), 2).execute(); break; case 4: cmd.track_linear (BTN_POS(2,3), BTN_SIZE(2,1), 4).execute(); break; case 5: cmd.track_linear (BTN_POS(2,4), BTN_SIZE(2,1), 5).execute(); break; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h index bdb9d492ab..7cc4e078ad 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h @@ -24,7 +24,7 @@ namespace Theme { #ifdef TOUCH_UI_800x480 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr int16_t font_tiny = 26; constexpr int16_t font_xsmall = 28; constexpr int16_t font_small = 29; @@ -41,7 +41,7 @@ namespace Theme { #endif constexpr float icon_scale = 1.0; #elif defined(TOUCH_UI_480x272) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr int16_t font_tiny = 26; constexpr int16_t font_xsmall = 26; constexpr int16_t font_small = 26; @@ -59,7 +59,7 @@ namespace Theme { constexpr float icon_scale = 0.6; #endif #elif defined(TOUCH_UI_320x240) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr int16_t font_tiny = 26; constexpr int16_t font_xsmall = 26; constexpr int16_t font_small = 26;