diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e6a7515f9507f..584335be24820 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1867,11 +1867,18 @@ //#define RGB_LED //#define RGBW_LED -#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - #define RGB_LED_R_PIN 34 - #define RGB_LED_G_PIN 43 - #define RGB_LED_B_PIN 35 - #define RGB_LED_W_PIN -1 +#if EITHER(RGB_LED, RGBW_LED) + //#define RGB_LED_R_PIN 34 + //#define RGB_LED_G_PIN 43 + //#define RGB_LED_B_PIN 35 + //#define RGB_LED_W_PIN -1 +#endif + +#if ANY(RGB_LED, RGBW_LED, PCA9632) + //#define RGB_STARTUP_TEST // For PWM pins, fade between all colors + #if ENABLED(RGB_STARTUP_TEST) + #define RGB_STARTUP_TEST_INNER_MS 10 // (ms) Reduce or increase fading speed + #endif #endif // Support for Adafruit Neopixel LED driver diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d517a28116e99..bf14a38ac99ac 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -146,10 +146,10 @@ * Thermistors able to support high temperature tend to have a hard time getting * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP * will probably be caught when the heating element first turns on during the - * preheating process, which will trigger a min_temp_error as a safety measure + * preheating process, which will trigger a MINTEMP error as a safety measure * and force stop everything. * To circumvent this limitation, we allow for a preheat time (during which, - * min_temp_error won't be triggered) and add a min_temp buffer to handle + * MINTEMP error won't be triggered) and add a min_temp buffer to handle * aberrant readings. * * If you want to enable this feature for your hotend thermistor(s) @@ -157,7 +157,7 @@ */ // The number of consecutive low temperature errors that can occur -// before a min_temp_error is triggered. (Shouldn't be more than 10.) +// before a MINTEMP error is triggered. (Shouldn't be more than 10.) //#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 // The number of milliseconds a hotend will preheat before starting to check diff --git a/Marlin/Version.h b/Marlin/Version.h index 6f7c7e463d8ef..e5e097683ca29 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-02" +//#define STRING_DISTRIBUTION_DATE "2023-01-09" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/SAMD21/timers.cpp b/Marlin/src/HAL/SAMD21/timers.cpp index 82fa162f1743e..b5f1d4f7bd80d 100644 --- a/Marlin/src/HAL/SAMD21/timers.cpp +++ b/Marlin/src/HAL/SAMD21/timers.cpp @@ -47,11 +47,11 @@ const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = { { {.pTcc=TCC0}, TimerType::tcc, TCC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper (assigned priority 2) { {.pTcc=TCC1}, TimerType::tcc, TCC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers) { {.pTcc=TCC2}, TimerType::tcc, TCC2_IRQn, 5 }, // 2 - tone (reserved by framework and fixed assigned priority 5) - { {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1) - { {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used) - { {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) }, - { {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) }, - { {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) }, + { {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1) + { {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used) + { {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) }, + { {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) }, + { {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) }, { {.pRtc=RTC}, TimerType::rtc, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature (assigned priority 6) }; diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index ea57e3ccd7829..676d230d35ea1 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -232,7 +232,7 @@ #include "feature/password/password.h" #endif -#if ENABLED(DGUS_LCD_UI_MKS) +#if DGUS_LCD_UI_MKS #include "lcd/extui/dgus/DGUSScreenHandler.h" #endif diff --git a/Marlin/src/feature/leds/leds.cpp b/Marlin/src/feature/leds/leds.cpp index 3753235ab5e76..94900445dcbc1 100644 --- a/Marlin/src/feature/leds/leds.cpp +++ b/Marlin/src/feature/leds/leds.cpp @@ -95,7 +95,62 @@ void LEDLights::setup() { delay(500); } #endif // RGB_STARTUP_TEST - #endif + + #elif BOTH(PCA9632, RGB_STARTUP_TEST) // PCA9632 RGB_STARTUP_TEST + + constexpr int8_t led_pin_count = TERN(HAS_WHITE_LED, 4, 3); + + // Startup animation + LEDColor curColor = LEDColorOff(); + PCA9632_set_led_color(curColor); // blackout + delay(200); + + /* + * LED Pin Counter steps -> events + * | 0-100 | 100-200 | 200-300 | 300-400 | + * fade in steady | fade out + * start next pin fade in + */ + + uint16_t led_pin_counters[led_pin_count] = { 1, 0, 0 }; + + bool canEnd = false; + while (led_pin_counters[0] != 99 || !canEnd) { + if (led_pin_counters[0] == 99) // End loop next time pin0 counter is 99 + canEnd = true; + LOOP_L_N(i, led_pin_count) { + if (led_pin_counters[i] > 0) { + if (++led_pin_counters[i] == 400) // turn off current pin counter in led_pin_counters + led_pin_counters[i] = 0; + else if (led_pin_counters[i] == 201) { // start next pin pwm + led_pin_counters[i + 1 == led_pin_count ? 0 : i + 1] = 1; + i++; // skip next pin in this loop so it doesn't increment twice + } + } + } + uint16_t r, g, b; + r = led_pin_counters[0]; curColor.r = r <= 100 ? r : r <= 300 ? 100 : 400 - r; + g = led_pin_counters[1]; curColor.g = g <= 100 ? g : g <= 300 ? 100 : 400 - g; + b = led_pin_counters[2]; curColor.b = b <= 100 ? b : b <= 300 ? 100 : 400 - b; + #if HAS_WHITE_LED + const uint16_t w = led_pin_counters[3]; curColor.w = w <= 100 ? w : w <= 300 ? 100 : 400 - w; + #endif + PCA9632_set_led_color(curColor); + delay(RGB_STARTUP_TEST_INNER_MS); + } + + // Fade to white + LOOP_LE_N(led_pwm, 100) { + NOLESS(curColor.r, led_pwm); + NOLESS(curColor.g, led_pwm); + NOLESS(curColor.b, led_pwm); + TERN_(HAS_WHITE_LED, NOLESS(curColor.w, led_pwm)); + PCA9632_set_led_color(curColor); + delay(RGB_STARTUP_TEST_INNER_MS); + } + + #endif // PCA9632 && RGB_STARTUP_TEST + TERN_(NEOPIXEL_LED, neo.init()); TERN_(PCA9533, PCA9533_init()); TERN_(LED_USER_PRESET_STARTUP, set_default()); diff --git a/Marlin/src/feature/leds/neopixel.cpp b/Marlin/src/feature/leds/neopixel.cpp index 4f104234f15c3..ab7ffe2177966 100644 --- a/Marlin/src/feature/leds/neopixel.cpp +++ b/Marlin/src/feature/leds/neopixel.cpp @@ -108,7 +108,7 @@ void Marlin_NeoPixel::init() { set_color(adaneo1.Color TERN(LED_USER_PRESET_STARTUP, (LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE), - (255, 255, 255, 255)) + (0, 0, 0, 0)) ); } diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 91d25d7187758..83d149fa09e78 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -211,7 +211,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load while (wait_for_user) { impatient_beep(max_beep_count); #if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR) - #if ENABLED(MULTI_FILAMENT_SENSOR) + #if MULTI_FILAMENT_SENSOR #define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break; switch (active_extruder) { REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED) @@ -410,7 +410,6 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool #endif TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR))); - TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause()); // Indicate that the printer is paused ++did_pause_print; @@ -461,6 +460,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool // If axes don't need to home then the nozzle can park if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move + TERN_(DWIN_LCD_PROUI, if (!do_park) ui.set_status(GET_TEXT_F(MSG_PARK_FAILED))); #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; @@ -710,13 +710,8 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ TERN_(HAS_FILAMENT_SENSOR, runout.reset()); - #if ENABLED(DWIN_LCD_PROUI) - DWIN_Print_Resume(); - HMI_ReturnScreen(); - #else - ui.reset_status(); - ui.return_to_status(); - #endif + ui.reset_status(); + ui.return_to_status(); } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index 9f4d569d7b2e5..12408c898755a 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -28,7 +28,7 @@ #include "../../module/temperature.h" #if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin_defines.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index e3ca43e17fd5f..a52c706fa6b5a 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -169,7 +169,7 @@ if (parser.seen("EPS")) { planner.synchronize(); if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly - else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index + else if (parser.seenval('E')) duplication_e_mask = _BV(parser.value_int() + 1) - 1; // Set the mask by E index ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0)); set_duplication_enabled(ena && (duplication_e_mask >= 3)); } diff --git a/Marlin/src/gcode/feature/input_shaping/M593.cpp b/Marlin/src/gcode/feature/input_shaping/M593.cpp index aafabb3cb7c62..a4b3cd3fee973 100644 --- a/Marlin/src/gcode/feature/input_shaping/M593.cpp +++ b/Marlin/src/gcode/feature/input_shaping/M593.cpp @@ -49,8 +49,8 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) { * D Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes. * F Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes. * T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet) - * X<1> Set the given parameters only for the X axis. - * Y<1> Set the given parameters only for the Y axis. + * X Set the given parameters only for the X axis. + * Y Set the given parameters only for the Y axis. */ void GcodeSuite::M593() { if (!parser.seen_any()) return M593_report(); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index bb859d8026419..f08ade8c38358 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -1081,7 +1081,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion #endif - #if ENABLED(DGUS_LCD_UI_MKS) + #if DGUS_LCD_UI_MKS case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 5d56e53dd5e04..b50d8363a4cf5 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -1226,7 +1226,7 @@ class GcodeSuite { static void M1001(); #endif - #if ENABLED(DGUS_LCD_UI_MKS) + #if DGUS_LCD_UI_MKS static void M1002(); #endif diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 8dbe2fb07e558..942d20afd2f83 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -47,7 +47,7 @@ void GcodeSuite::M145() { preheat_t &mat = ui.material_preset[material]; #if HAS_HOTEND if (parser.seenval('H')) - mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, thermalManager.hotend_max_target(0)); + mat.hotend_temp = constrain(parser.value_int(), thermalManager.extrude_min_temp, thermalManager.hotend_max_target(0)); #endif #if HAS_HEATED_BED if (parser.seenval('B')) diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index f404358862419..c7728a5a477fe 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -109,7 +109,6 @@ void GcodeSuite::M1001() { #endif TERN_(EXTENSIBLE_UI, ExtUI::onPrintDone()); - TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished()); // Re-select the last printed file in the UI TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); diff --git a/Marlin/src/gcode/sd/M24_M25.cpp b/Marlin/src/gcode/sd/M24_M25.cpp index 64ac0cce09fd1..847af65b12083 100644 --- a/Marlin/src/gcode/sd/M24_M25.cpp +++ b/Marlin/src/gcode/sd/M24_M25.cpp @@ -41,7 +41,7 @@ #include "../../feature/powerloss.h" #endif -#if ENABLED(DGUS_LCD_UI_MKS) +#if DGUS_LCD_UI_MKS #include "../../lcd/extui/dgus/DGUSDisplayDef.h" #endif @@ -52,7 +52,7 @@ */ void GcodeSuite::M24() { - #if ENABLED(DGUS_LCD_UI_MKS) + #if DGUS_LCD_UI_MKS if ((print_job_timer.isPaused() || print_job_timer.isRunning()) && !parser.seen("ST")) MKS_resume_print_move(); #endif diff --git a/Marlin/src/gcode/sd/M524.cpp b/Marlin/src/gcode/sd/M524.cpp index 001a1e184263a..f2b9274223c25 100644 --- a/Marlin/src/gcode/sd/M524.cpp +++ b/Marlin/src/gcode/sd/M524.cpp @@ -28,7 +28,7 @@ #include "../../sd/cardreader.h" #if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" + #include "../../lcd/marlinui.h" #endif /** @@ -38,7 +38,7 @@ void GcodeSuite::M524() { #if ENABLED(DWIN_LCD_PROUI) - HMI_flag.abort_flag = true; // The LCD will handle it + ui.abort_print(); #else diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 0ed1e66930136..2ff04797eb280 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -39,7 +39,6 @@ void GcodeSuite::M75() { startOrResumeJob(); #if ENABLED(DWIN_LCD_PROUI) - DWIN_Print_Started(false); if (!IS_SD_PRINTING()) DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT)); #endif } @@ -48,9 +47,8 @@ void GcodeSuite::M75() { * M76: Pause print timer */ void GcodeSuite::M76() { - print_job_timer.pause(); + TERN(DWIN_LCD_PROUI, ui.pause_print(), print_job_timer.pause()); TERN_(HOST_PAUSE_M76, hostui.pause()); - TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause()); } /** @@ -58,7 +56,6 @@ void GcodeSuite::M76() { */ void GcodeSuite::M77() { print_job_timer.stop(); - TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished()); } #if ENABLED(PRINTCOUNTER) diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index a4d514c7334f6..820b1556d6117 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -61,15 +61,9 @@ void GcodeSuite::M303() { const heater_id_t hid = (heater_id_t)parser.intval('E'); celsius_t default_temp; switch (hid) { - #if ENABLED(PIDTEMP) - case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break; - #endif - #if ENABLED(PIDTEMPBED) - case H_BED: default_temp = PREHEAT_1_TEMP_BED; break; - #endif - #if ENABLED(PIDTEMPCHAMBER) - case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break; - #endif + OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break) + OPTCODE(PIDTEMPBED, case H_BED: default_temp = PREHEAT_1_TEMP_BED; break) + OPTCODE(PIDTEMPCHAMBER, case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break) default: SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); @@ -84,9 +78,15 @@ void GcodeSuite::M303() { const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); - #if ENABLED(DWIN_LCD_PROUI) + #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) if (seenC) HMI_data.PidCycles = c; - if (seenS) { if (hid == H_BED) HMI_data.BedPidT = temp; else HMI_data.HotendPidT = temp; } + if (seenS) { + switch (hid) { + OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: HMI_data.HotendPidT = temp; break) + OPTCODE(PIDTEMPBED, case H_BED: HMI_data.BedPidT = temp; break) + default: break; + } + } #endif #if DISABLED(BUSY_WHILE_HEATING) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 6a1d0dbefb3d4..0a66284df6d20 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -36,19 +36,19 @@ #define FYSETC_MINI_12864_2_1 #endif -// Updated DGUS_UI shorthand single option can be used, or old settings, for now +// Old settings are now conditional on DGUS_LCD_UI #if DGUS_UI_IS(ORIGIN) - #define DGUS_LCD_UI_ORIGIN + #define DGUS_LCD_UI_ORIGIN 1 #elif DGUS_UI_IS(FYSETC) - #define DGUS_LCD_UI_FYSETC + #define DGUS_LCD_UI_FYSETC 1 #elif DGUS_UI_IS(HIPRECY) - #define DGUS_LCD_UI_HIPRECY + #define DGUS_LCD_UI_HIPRECY 1 #elif DGUS_UI_IS(MKS) - #define DGUS_LCD_UI_MKS + #define DGUS_LCD_UI_MKS 1 #elif DGUS_UI_IS(RELOADED) - #define DGUS_LCD_UI_RELOADED + #define DGUS_LCD_UI_RELOADED 1 #elif DGUS_UI_IS(IA_CREALITY) - #define DGUS_LCD_UI_IA_CREALITY + #define DGUS_LCD_UI_IA_CREALITY 1 #endif /** diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 18a28130eb809..b9bcb4d0d2867 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2472,6 +2472,7 @@ #define BED_MAX_TARGET (BED_MAXTEMP - (BED_OVERSHOOT)) #else #undef PIDTEMPBED + #undef PREHEAT_BEFORE_LEVELING #endif #if HAS_TEMP_COOLER && PIN_EXISTS(COOLER) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ce7fe8091ba21..2ef6fd33567d8 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -656,6 +656,8 @@ #error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA." #elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND) #error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND." +#elif ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) && !defined(DGUS_LCD_UI) + #error "DGUS_LCD_UI_[TYPE] is now set using DGUS_LCD_UI TYPE." #endif // L64xx stepper drivers have been removed @@ -940,8 +942,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu." #endif -#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI) && !defined(MANUAL_FEEDRATE) - #error "MANUAL_FEEDRATE is required for MarlinUI, ExtUI, or FTDI EVE Touch UI." +#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI, DWIN_LCD_PROUI) && !defined(MANUAL_FEEDRATE) + #error "MANUAL_FEEDRATE is required for ProUI, MarlinUI, ExtUI, or FTDI EVE Touch UI." #endif /** @@ -4325,6 +4327,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "DGUS_LCD_UI IA_CREALITY requires CLASSIC_JERK." #elif DISABLED(BABYSTEPPING) #error "DGUS_LCD_UI IA_CREALITY requires BABYSTEPPING." + #elif NUM_RUNOUT_SENSORS > 1 + #error "DGUS_LCD_UI IA_CREALITY requires NUM_RUNOUT_SENSORS < 2." #elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) #error "DGUS_LCD_UI IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, or MESH_BED_LEVELING." #endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index f581319325474..97b10122d6553 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-01-02" + #define STRING_DISTRIBUTION_DATE "2023-01-09" #endif /** diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index e0f179d82844e..24f4d7fbe9f39 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -777,13 +777,6 @@ #warning "Define MK3_FAN_PINS to swap hotend and part cooling fan pins. (Define NO_MK3_FAN_PINS_WARNING to suppress this warning.)" #endif -/** - * Endstop Interrupts is Indicated - */ -#if DISABLED(ENDSTOP_INTERRUPTS_FEATURE) - #warning "ENDSTOP_INTERRUPTS_FEATURE should be enabled for production use if possible!" -#endif - /** * BD Sensor should always include BABYSTEPPING */ diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index cf0d6dc8fccc1..0f78e58ef5d7f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1213,7 +1213,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) Popup_Handler(ETemp); else { - if (thermalManager.temp_hotend[0].is_below_target(-2)) { + if (thermalManager.temp_hotend[0].is_below_target(2)) { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); } @@ -1356,7 +1356,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Popup_Handler(ETemp); } else { - if (thermalManager.temp_hotend[0].is_below_target(-2)) { + if (thermalManager.temp_hotend[0].is_below_target(2)) { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); Redraw_Menu(); @@ -1743,7 +1743,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) Popup_Handler(ETemp); else { - if (thermalManager.temp_hotend[0].is_below_target(-2)) { + if (thermalManager.temp_hotend[0].is_below_target(2)) { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); } @@ -1762,7 +1762,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Popup_Handler(ETemp); } else { - if (thermalManager.temp_hotend[0].is_below_target(-2)) { + if (thermalManager.temp_hotend[0].is_below_target(2)) { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); } @@ -1780,7 +1780,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) Popup_Handler(ETemp); else { - if (thermalManager.temp_hotend[0].is_below_target(-2)) { + if (thermalManager.temp_hotend[0].is_below_target(2)) { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); } @@ -4505,7 +4505,7 @@ void CrealityDWINClass::Popup_Control() { if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) Popup_Handler(ETemp); else { - if (thermalManager.temp_hotend[0].is_below_target(-2)) { + if (thermalManager.temp_hotend[0].is_below_target(2)) { Popup_Handler(Heating); thermalManager.wait_for_hotend(0); } diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 73f4386011e8e..205913ca694a1 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -315,7 +315,7 @@ void MarlinUI::draw_status_screen() { // Draw a frame around the x/y/z values DWIN_Draw_Rectangle(0, Select_Color, #if ENABLED(DWIN_MARLINUI_PORTRAIT) - 0, 193, LCD_PIXEL_WIDTH, 260 + 0, 193, LCD_PIXEL_WIDTH - 1, 260 #else 0, 115, LCD_PIXEL_WIDTH - 1, 152 #endif diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index e967c26198bef..760582c76a75c 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -23,23 +23,33 @@ /** * Bed Level Tools for Pro UI * Extended by: Miguel A. Risco-Castillo (MRISCOC) - * Version: 2.0.0 - * Date: 2022/05/23 + * Version: 2.1.0 + * Date: 2022/08/27 * * Based on the original work of: Henri-J-Norden * https://github.com/Jyers/Marlin/pull/126 + * + * 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 . + * */ #include "../../../inc/MarlinConfigPre.h" -#include "bedlevel_tools.h" #if BOTH(DWIN_LCD_PROUI, HAS_LEVELING) #include "../../marlinui.h" #include "../../../core/types.h" -#include "dwin.h" -#include "dwinui.h" -#include "dwin_popup.h" #include "../../../feature/bedlevel/bedlevel.h" #include "../../../module/probe.h" #include "../../../gcode/gcode.h" @@ -48,9 +58,14 @@ #include "../../../libs/least_squares_fit.h" #include "../../../libs/vector_3.h" -BedLevelToolsClass BedLevelTools; +#include "dwin.h" +#include "dwinui.h" +#include "dwin_popup.h" +#include "bedlevel_tools.h" + +BedLevelToolsClass bedLevelTools; -#if USE_UBL_VIEWER +#if ENABLED(USE_UBL_VIEWER) bool BedLevelToolsClass::viewer_asymmetric_range = false; bool BedLevelToolsClass::viewer_print_value = false; #endif @@ -153,26 +168,30 @@ void BedLevelToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, } } +// Move / Probe methods. As examples, not yet used. void BedLevelToolsClass::MoveToXYZ() { - BedLevelTools.goto_mesh_value = true; - BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false); + bedLevelTools.goto_mesh_value = true; + bedLevelTools.manual_move(bedLevelTools.mesh_x, bedLevelTools.mesh_y, false); } void BedLevelToolsClass::MoveToXY() { - BedLevelTools.goto_mesh_value = false; - BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false); + bedLevelTools.goto_mesh_value = false; + bedLevelTools.manual_move(bedLevelTools.mesh_x, bedLevelTools.mesh_y, false); } void BedLevelToolsClass::MoveToZ() { - BedLevelTools.goto_mesh_value = true; - BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, true); + bedLevelTools.goto_mesh_value = true; + bedLevelTools.manual_move(bedLevelTools.mesh_x, bedLevelTools.mesh_y, true); } void BedLevelToolsClass::ProbeXY() { - sprintf_P(cmd, PSTR("G30X%sY%s"), - dtostrf(bedlevel.get_mesh_x(BedLevelTools.mesh_x), 1, 2, str_1), - dtostrf(bedlevel.get_mesh_y(BedLevelTools.mesh_y), 1, 2, str_2) + const uint16_t Clear = Z_CLEARANCE_DEPLOY_PROBE; + sprintf_P(cmd, PSTR("G0Z%i\nG30X%sY%s"), + Clear, + dtostrf(bedlevel.get_mesh_x(bedLevelTools.mesh_x), 1, 2, str_1), + dtostrf(bedlevel.get_mesh_y(bedLevelTools.mesh_y), 1, 2, str_2) ); gcode.process_subcommands_now(cmd); } +// Accessors float BedLevelToolsClass::get_max_value() { float max = __FLT_MAX__ * -1; GRID_LOOP(x, y) { @@ -191,18 +210,16 @@ float BedLevelToolsClass::get_min_value() { return min; } +// Return 'true' if mesh is good and within LCD limits bool BedLevelToolsClass::meshvalidate() { - float min = __FLT_MAX__, max = __FLT_MAX__ * -1; - GRID_LOOP(x, y) { - if (isnan(bedlevel.z_values[x][y])) return false; - if (bedlevel.z_values[x][y] < min) min = bedlevel.z_values[x][y]; - if (bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y]; + const float v = bedlevel.z_values[x][y]; + if (isnan(v) || !WITHIN(v, UBL_Z_OFFSET_MIN, UBL_Z_OFFSET_MAX)) return false; } - return WITHIN(max, MESH_Z_OFFSET_MIN, MESH_Z_OFFSET_MAX); + return true; } -#if USE_UBL_VIEWER +#if ENABLED(USE_UBL_VIEWER) void BedLevelToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) { drawing_mesh = true; diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h index 9373d593f9698..6e642f030c18e 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h @@ -23,27 +23,38 @@ /** * Bed Level Tools for Pro UI * Extended by: Miguel A. Risco-Castillo (MRISCOC) - * Version: 2.0.0 - * Date: 2022/05/23 + * Version: 2.1.0 + * Date: 2022/08/27 * * Based on the original work of: Henri-J-Norden * https://github.com/Jyers/Marlin/pull/126 + * + * 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 . + * */ - #pragma once #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(AUTO_BED_LEVELING_UBL) - //#define USE_UBL_VIEWER 1 -#endif +//#define USE_UBL_VIEWER 1 -#define MESH_Z_OFFSET_MIN -3.0 -#define MESH_Z_OFFSET_MAX 3.0 +#define UBL_Z_OFFSET_MIN -3.0 +#define UBL_Z_OFFSET_MAX 3.0 class BedLevelToolsClass { public: - #if USE_UBL_VIEWER + #if ENABLED(USE_UBL_VIEWER) static bool viewer_asymmetric_range; static bool viewer_print_value; #endif @@ -66,12 +77,10 @@ class BedLevelToolsClass { static float get_max_value(); static float get_min_value(); static bool meshvalidate(); - #if USE_UBL_VIEWER + #if ENABLED(USE_UBL_VIEWER) static void Draw_Bed_Mesh(int16_t selected = -1, uint8_t gridline_width = 1, uint16_t padding_x = 8, uint16_t padding_y_top = 40 + 53 - 7); static void Set_Mesh_Viewer_Status(); #endif }; -extern BedLevelToolsClass BedLevelTools; - -void Goto_MeshViewer(); +extern BedLevelToolsClass bedLevelTools; diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index fcceb2d52d513..deefbf25734b6 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -23,8 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.17.2 - * Date: 2022/04/08 + * Version: 3.21.2 + * Date: 2022/12/02 */ #include "../../../inc/MarlinConfig.h" @@ -62,10 +62,6 @@ #warning "MESH_EDIT_MENU is recommended with ProUI." #endif -#include "dwin.h" -#include "menus.h" -#include "dwin_popup.h" - #include "../../fontutils.h" #include "../../marlinui.h" @@ -78,6 +74,7 @@ #include "../../../module/temperature.h" #include "../../../module/printcounter.h" #include "../../../module/motion.h" +#include "../../../module/stepper.h" #include "../../../module/planner.h" #include "../../../gcode/gcode.h" @@ -126,46 +123,52 @@ #include "../../../feature/powerloss.h" #endif -#if HAS_ESDIAG - #include "endstop_diag.h" +#if ENABLED(PRINTCOUNTER) + #include "printstats.h" #endif -#if HAS_PIDPLOT - #include "plot.h" +#if ENABLED(CASE_LIGHT_MENU) + #include "../../../feature/caselight.h" #endif -#if HAS_GCODE_PREVIEW - #include "gcode_preview.h" +#if ENABLED(LED_CONTROL_MENU) + #include "../../../feature/leds/leds.h" #endif -#if HAS_MESH - #include "meshviewer.h" +#include "dwin.h" +#include "dwinui.h" +#include "menus.h" +#include "dwin_popup.h" + +#if HAS_GCODE_PREVIEW + #include "gcode_preview.h" #endif -#if ENABLED(PRINTCOUNTER) - #include "printstats.h" +#if HAS_ESDIAG + #include "endstop_diag.h" #endif -#if ENABLED(CASE_LIGHT_MENU) - #include "../../../feature/caselight.h" +#if HAS_PIDPLOT + #include "plot.h" #endif -#if ENABLED(LED_CONTROL_MENU) - #include "../../../feature/leds/leds.h" +#if HAS_MESH + #include "meshviewer.h" #endif #if HAS_LOCKSCREEN #include "lockscreen.h" #endif +#define DEBUG_OUT ENABLED(DEBUG_DWIN) +#include "../../../core/debug_out.h" + #ifndef MACHINE_SIZE #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #endif #define PAUSE_HEAT -#define MENU_CHAR_LIMIT 24 - // Print speed limit #define MIN_PRINT_SPEED 10 #define MAX_PRINT_SPEED 999 @@ -186,14 +189,12 @@ // Editable temperature limits #define MIN_ETEMP 0 -#define MAX_ETEMP (HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT)) +#define MAX_ETEMP (thermalManager.hotend_maxtemp[0] - (HOTEND_OVERSHOOT)) #define MIN_BEDTEMP 0 #define MAX_BEDTEMP BED_MAX_TARGET -#define FEEDRATE_E (60) - #define DWIN_VAR_UPDATE_INTERVAL 1024 -#define DWIN_SCROLL_UPDATE_INTERVAL SEC_TO_MS(2) +#define DWIN_UPDATE_INTERVAL 1024 #define DWIN_REMAIN_TIME_UPDATE_INTERVAL SEC_TO_MS(20) #if HAS_MESH @@ -208,10 +209,6 @@ HMI_value_t HMI_value; HMI_flag_t HMI_flag{0}; HMI_data_t HMI_data; -millis_t dwin_heat_time = 0; - -uint8_t checkkey = 255, last_checkkey = MainMenu; - enum SelectItem : uint8_t { PAGE_PRINT = 0, PAGE_PREPARE, @@ -233,11 +230,7 @@ typedef struct { bool dec() { if (now) now--; return changed(); } bool inc(uint8_t v) { if (now < (v - 1)) now++; else now = (v - 1); return changed(); } } select_t; - -select_t select_page{0}, select_file{0}, select_print{0}; -uint8_t index_file = MROWS; - -bool hash_changed = true; // Flag to know if message status was changed +select_t select_page{0}, select_print{0}; constexpr float max_feedrate_edit_values[] = #ifdef MAX_FEEDRATE_EDIT_VALUES @@ -265,17 +258,21 @@ constexpr float max_acceleration_edit_values[] = ; #endif -static uint8_t _percent_done = 0; -static uint32_t _remain_time = 0; - -// Additional Aux Host Support -static bool sdprint = false; - #if HAS_HOTEND float last_E = 0; + #define E_MIN_POS (last_E - (EXTRUDE_MAXLENGTH)) + #define E_MAX_POS (last_E + (EXTRUDE_MAXLENGTH)) #endif +bool hash_changed = true; // Flag to know if message status was changed +uint8_t _percent_done = 0; +uint32_t _remain_time = 0; +bool blink = false; +millis_t dwin_heat_time = 0; +uint8_t checkkey = 255, last_checkkey = MainMenu; + // New menu system pointers +MenuClass *FileMenu = nullptr; MenuClass *PrepareMenu = nullptr; MenuClass *TrammingMenu = nullptr; MenuClass *MoveMenu = nullptr; @@ -306,8 +303,12 @@ MenuClass *MaxAccelMenu = nullptr; MenuClass *MaxJerkMenu = nullptr; #endif MenuClass *StepsMenu = nullptr; -MenuClass *HotendPIDMenu = nullptr; -MenuClass *BedPIDMenu = nullptr; +#if ENABLED(PIDTEMP) + MenuClass *HotendPIDMenu = nullptr; +#endif +#if ENABLED(PIDTEMPBED) + MenuClass *BedPIDMenu = nullptr; +#endif #if ENABLED(CASELIGHT_USES_BRIGHTNESS) MenuClass *CaseLightMenu = nullptr; #endif @@ -337,6 +338,10 @@ MenuItemClass *FanSpeedItem = nullptr; MenuItemClass *MMeshMoveZItem = nullptr; MenuItemClass *EditZValueItem = nullptr; +bool Printing() { return printingIsActive() || printingIsPaused(); } +bool SD_Printing() { return Printing() && IS_SD_FILE_OPEN(); } +bool Host_Printing() { return Printing() && !IS_SD_FILE_OPEN(); } + #define DWIN_LANGUAGE_EEPROM_ADDRESS 0x01 // Between 0x01 and 0x63 (EEPROM_OFFSET-1) // BL24CXX::check() uses 0x00 @@ -368,7 +373,7 @@ void HMI_ToggleLanguage() { typedef struct { uint16_t x, y[2], w, h; } text_info_t; void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico, const text_info_t (&txt), FSTR_P caption) { - DWIN_ICON_Show(true, false, false, ICON, iconid + selected, ico.x, ico.y); + DWINUI::Draw_IconWB(iconid + selected, ico.x, ico.y); if (selected) DWINUI::Draw_Box(0, HMI_data.Highlight_Color, ico); if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 25) - txt.h/2); @@ -452,47 +457,9 @@ void ICON_Stop() { ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt, GET_TEXT_F(MSG_BUTTON_STOP)); } -//----------------------------------------------------------------------------- -// Drawing routines -//----------------------------------------------------------------------------- - -void Move_Highlight(const int8_t from, const int8_t newline) { - Erase_Menu_Cursor(newline - from); - Draw_Menu_Cursor(newline); -} - -void Add_Menu_Line() { - Move_Highlight(1, MROWS); - DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(MROWS + 1), 240); -} - -void Scroll_Menu(const uint8_t dir) { - DWIN_Frame_AreaMove(1, dir, MLINE, HMI_data.Background_Color, 0, 31, DWIN_WIDTH, 349); - switch (dir) { - case DWIN_SCROLL_DOWN: Move_Highlight(-1, 0); break; - case DWIN_SCROLL_UP: Add_Menu_Line(); break; - } -} - -inline uint16_t nr_sd_menu_items() { - return card.get_num_Files() + !card.flag.workDirIsRoot; -} - -void Erase_Menu_Text(const uint8_t line) { - DWIN_Draw_Rectangle(1, HMI_data.Background_Color, LBLX, MBASE(line) - 14, 271, MBASE(line) + 28); -} - -// Draw "Back" line at the top -void Draw_Back_First(const bool is_sel=true) { - Draw_Menu_Line(0, ICON_Back); - if (HMI_IsChinese()) - DWIN_Frame_AreaCopy(1, 129, 72, 156, 84, LBLX, MBASE(0)); - else - DWINUI::Draw_String(LBLX, MBASE(0), GET_TEXT_F(MSG_BACK)); - if (is_sel) Draw_Menu_Cursor(0); -} - +// //PopUps +// void Popup_window_PauseOrStop() { if (HMI_IsChinese()) { DWINUI::ClearMainArea(); @@ -546,15 +513,19 @@ void Popup_window_PauseOrStop() { DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); } } - else DWIN_Show_Popup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low"), BTN_Continue); + else + DWIN_Show_Popup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low"), BTN_Continue); } #endif +// // Draw status line -void DWIN_DrawStatusLine() { +// +void DWIN_DrawStatusLine(const char *text) { DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); - DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, ui.status_message); + if (text) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, text); } +void DWIN_DrawStatusLine(FSTR_P fstr) { DWIN_DrawStatusLine(FTOP(fstr)); } // Clear & reset status line void DWIN_ResetStatusLine() { @@ -563,12 +534,16 @@ void DWIN_ResetStatusLine() { } // Djb2 hash algorithm -void DWIN_CheckStatusMessage() { - static uint32_t old_hash = 0; - char * str = &ui.status_message[0]; +uint32_t GetHash(char * str) { uint32_t hash = 5381; char c; while ((c = *str++)) hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ + return hash; +} + +void DWIN_CheckStatusMessage() { + static uint32_t old_hash = 0; + uint32_t hash = GetHash(&ui.status_message[0]); hash_changed = hash != old_hash; old_hash = hash; }; @@ -582,7 +557,7 @@ void DWIN_DrawStatusMessage() { // If the string fits the status line do not scroll it if (slen <= LCD_WIDTH) { if (hash_changed) { - DWIN_DrawStatusLine(); + DWIN_DrawStatusLine(ui.status_message); hash_changed = false; } } @@ -601,7 +576,7 @@ void DWIN_DrawStatusMessage() { if (rlen < LCD_WIDTH) { DWINUI::Draw_Char(HMI_data.StatusTxt_Color, '.'); // Always at 1+ spaces left, draw a dot uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - if (--chars) { // Draw a second dot if there's space + if (--chars) { // Draw a second dot if there's space DWINUI::Draw_Char(HMI_data.StatusTxt_Color, '.'); if (--chars) DWINUI::Draw_String(HMI_data.StatusTxt_Color, ui.status_message, chars); // Print a second copy of the message @@ -614,7 +589,7 @@ void DWIN_DrawStatusMessage() { if (hash_changed) { ui.status_message[LCD_WIDTH] = 0; - DWIN_DrawStatusLine(); + DWIN_DrawStatusLine(ui.status_message); hash_changed = false; } @@ -633,7 +608,7 @@ void Draw_Print_Labels() { } void Draw_Print_ProgressBar() { - DWIN_ICON_Show(true, false, false, ICON, ICON_Bar, 15, 93); + DWINUI::Draw_IconWB(ICON_Bar, 15, 93); DWIN_Draw_Rectangle(1, HMI_data.Barfill_Color, 16 + _percent_done * 240 / 100, 93, 256, 113); DWINUI::Draw_Int(HMI_data.PercentTxt_Color, HMI_data.Background_Color, 3, 117, 133, _percent_done); DWINUI::Draw_String(HMI_data.PercentTxt_Color, 142, 133, F("%")); @@ -657,7 +632,7 @@ void ICON_ResumeOrPause() { } // Update filename on print -void DWIN_Print_Header(const char *text=nullptr) { +void DWIN_Print_Header(const char *text = nullptr) { static char headertxt[31] = ""; // Print header text if (text) { const int8_t size = _MIN(30U, strlen_P(text)); @@ -676,7 +651,7 @@ void Draw_PrintProcess() { else Title.ShowCaption(GET_TEXT_F(MSG_PRINTING)); DWINUI::ClearMainArea(); - DWIN_Print_Header(sdprint ? card.longest_filename() : nullptr); + DWIN_Print_Header(SD_Printing() ? card.longest_filename() : nullptr); Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); @@ -707,11 +682,14 @@ void Draw_PrintDone() { Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); - if (sdprint && TERN0(HAS_GCODE_PREVIEW, Preview_Valid())) { - DWIN_ICON_Show(0, 0, 1, 21, 100, 0x00); - DWINUI::Draw_Button(BTN_Continue, 86, 300); - } - else { + #if HAS_GCODE_PREVIEW + if (Preview_Valid()) { + DWIN_ICON_Show(0, 0, 1, 21, 100, 0x00); + DWINUI::Draw_Button(BTN_Continue, 86, 300); + } + else + #endif + { Draw_Print_ProgressBar(); Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); @@ -738,7 +716,6 @@ void Draw_Main_Menu() { else Title.ShowCaption(MACHINE_NAME); DWINUI::Draw_Icon(ICON_LOGO, 71, 52); // CREALITY logo - DWIN_ResetStatusLine(); ICON_Print(); ICON_Prepare(); ICON_Control(); @@ -753,13 +730,19 @@ void Goto_Main_Menu() { } // Draw X, Y, Z and blink if in an un-homed or un-trusted state -void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, const bool blink, const bool force) { +void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, const bool force) { const bool draw_qmark = axis_should_home(axis), draw_empty = NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !draw_qmark && !axis_is_trusted(axis); // Check for a position change static xyz_pos_t oldpos = { -1, -1, -1 }; - const float p = current_position[axis]; + + #if ENABLED(SHOW_REAL_POS) + const float p = stepper.position(axis) / planner.settings.axis_steps_per_mm[axis]; + #else + const float p = current_position[axis]; + #endif + const bool changed = oldpos[axis] != p; if (changed) oldpos[axis] = p; @@ -773,18 +756,38 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, } } +void _draw_ZOffsetIcon() { + #if HAS_LEVELING + #if NO_BLINK_LEV_IND + static bool _leveling_active = false; + if (_leveling_active != planner.leveling_active) { + _leveling_active = planner.leveling_active; + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 186, 415, 205, 436); + DWINUI::Draw_Icon(_leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416); + } + #else + if (planner.leveling_active) { + DWIN_Draw_Rectangle(1, blink ? HMI_data.SplitLine_Color : HMI_data.Background_Color, 186, 415, 205, 436); + DWINUI::Draw_Icon(ICON_SetZOffset, 186, 416); + } + static bool _leveling_active = false; + if (_leveling_active != planner.leveling_active) { + _leveling_active = planner.leveling_active; + if (!_leveling_active) { + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 186, 415, 205, 436); + DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); + } + } + #endif + #else + DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); + #endif +} + void _draw_xyz_position(const bool force) { - //SERIAL_ECHOPGM("Draw XYZ:"); - static bool _blink = false; - const bool blink = !!(millis() & 0x400UL); - if (force || blink != _blink) { - _blink = blink; - //SERIAL_ECHOPGM(" (blink)"); - _update_axis_value(X_AXIS, 27, 459, blink, true); - _update_axis_value(Y_AXIS, 112, 459, blink, true); - _update_axis_value(Z_AXIS, 197, 459, blink, true); - } - //SERIAL_EOL(); + _update_axis_value(X_AXIS, 27, 459, force); + _update_axis_value(Y_AXIS, 112, 459, force); + _update_axis_value(Z_AXIS, 197, 459, force); } void update_variable() { @@ -812,7 +815,7 @@ void update_variable() { if (_new_fanspeed) _fanspeed = thermalManager.fan_speed[0]; #endif - if (checkkey == Menu && (CurrentMenu == TuneMenu || CurrentMenu == TemperatureMenu)) { + if (IsMenu(TuneMenu) || IsMenu(TemperatureMenu)) { // Tune page temperature update #if HAS_HOTEND if (_new_hotend_target) HotendTargetItem->redraw(); @@ -866,34 +869,23 @@ void update_variable() { DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 204, 417, _offset); } - #if HAS_MESH - static bool _leveling_active = false; - if (_leveling_active != planner.leveling_active) { - _leveling_active = planner.leveling_active; - DWIN_Draw_Box(1, HMI_data.Background_Color, 186, 416, 20, 20); - if (_leveling_active) - DWINUI::Draw_Icon(ICON_SetZOffset, 186, 416); - else - DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); - } - #else - DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); - #endif - + _draw_ZOffsetIcon(); _draw_xyz_position(false); } /** - * Read and cache the working directory. - * - * TODO: New code can follow the pattern of menu_media.cpp - * and rely on Marlin caching for performance. No need to - * cache files here. + * Memory card and file management */ -#ifndef strcasecmp_P - #define strcasecmp_P(a, b) strcasecmp((a), (b)) -#endif +bool DWIN_lcd_sd_status = false; + +void SetMediaAutoMount() { + Toogle_Chkb_Line(HMI_data.MediaAutoMount); +} + +inline uint16_t nr_sd_menu_items() { + return _MIN(card.get_num_Files() + !card.flag.workDirIsRoot, MENU_MAX_ITEMS); +} void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) { size_t pos = strlen(src); // index of ending nul @@ -919,117 +911,121 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) while (pos--) dst[pos] = src[pos]; } -void HMI_SDCardInit() { card.cdroot(); } - -#if ENABLED(SCROLL_LONG_FILENAMES) - - char shift_name[LONG_FILENAME_LENGTH + 1]; - int8_t shift_amt; // = 0 - millis_t shift_ms; // = 0 - - // Init the shift name based on the highlighted item - void Init_Shift_Name() { - const bool is_subdir = !card.flag.workDirIsRoot; - const int8_t filenum = select_file.now - 1 - is_subdir; // Skip "Back" and ".." - const uint16_t fileCnt = card.get_num_Files(); - if (WITHIN(filenum, 0, fileCnt - 1)) { - card.getfilename_sorted(SD_ORDER(filenum, fileCnt)); - char * const name = card.longest_filename(); - make_name_without_ext(shift_name, name, 100); - } - } - - void Init_SDItem_Shift() { - shift_amt = 0; - shift_ms = select_file.now > 0 && strlen(shift_name) > MENU_CHAR_LIMIT ? millis() + 750UL : 0; - } +void Redraw_SD_List() { + InvalidateMenu(); + Draw_Print_File_Menu(); +} -#endif +void SDCard_Up() { + card.cdup(); + DWIN_lcd_sd_status = false; // On next DWIN_Update +} -/** - * Display an SD item, adding a CDUP for subfolders. - */ -void Draw_SDItem(const uint16_t item, int16_t row=-1) { - if (row < 0) row = item + 1 + MROWS - index_file; - const bool is_subdir = !card.flag.workDirIsRoot; - if (is_subdir && item == 0) - return Draw_Menu_Line(row, ICON_Folder, ".."); +void SDCard_Folder(char * const dirname) { + card.cd(dirname); + DWIN_lcd_sd_status = false; // On next DWIN_Update +} - card.getfilename_sorted(SD_ORDER(item - is_subdir, card.get_num_Files())); - char * const name = card.longest_filename(); +void onClickSDItem() { + const uint16_t hasUpDir = !card.flag.workDirIsRoot; + if (hasUpDir && CurrentMenu->selected == 1) return SDCard_Up(); + else { + const uint16_t filenum = CurrentMenu->selected - 1 - hasUpDir; + card.getfilename_sorted(SD_ORDER(filenum, card.get_num_Files())); - #if ENABLED(SCROLL_LONG_FILENAMES) - // Init the current selected name - // This is used during scroll drawing - if (item == select_file.now - 1) { - make_name_without_ext(shift_name, name, 100); - Init_SDItem_Shift(); - } - #endif + // Enter that folder! + if (card.flag.filenameIsDir) return SDCard_Folder(card.filename); - // Draw the file/folder with name aligned left - char str[strlen(name) + 1]; - make_name_without_ext(str, name); - const uint8_t icon = card.flag.filenameIsDir ? ICON_Folder : card.fileIsBinary() ? ICON_Binary : ICON_File; - Draw_Menu_Line(row, icon, str); + if (card.fileIsBinary()) + return DWIN_Popup_Confirm(ICON_Error, F("Please check filenames"), F("Only G-code can be printed")); + else + return Goto_ConfirmToPrint(); + } } #if ENABLED(SCROLL_LONG_FILENAMES) + char shift_name[LONG_FILENAME_LENGTH + 1] = ""; void Draw_SDItem_Shifted(uint8_t &shift) { - // Limit to the number of chars past the cutoff - const size_t len = strlen(shift_name); - NOMORE(shift, _MAX(len - MENU_CHAR_LIMIT, 0U)); - // Shorten to the available space - const size_t lastchar = _MIN((signed)len, shift + MENU_CHAR_LIMIT); - + const size_t lastchar = shift + MENU_CHAR_LIMIT; const char c = shift_name[lastchar]; shift_name[lastchar] = '\0'; - const uint8_t row = select_file.now + MROWS - index_file; // skip "Back" and scroll + const uint8_t row = FileMenu->line(); Erase_Menu_Text(row); Draw_Menu_Line(row, 0, &shift_name[shift]); shift_name[lastchar] = c; } + void FileMenuIdle(bool reset=false) { + static bool hasUpDir = false; + static uint8_t last_itemselected = 0; + static int8_t shift_amt = 0; + static int8_t shift_len = 0; + if (reset) { + last_itemselected = 0; + hasUpDir = !card.flag.workDirIsRoot; // is a SubDir + return; + } + const uint8_t selected = FileMenu->selected; + if (last_itemselected != selected) { + if (last_itemselected >= 1 + hasUpDir) FileMenu->Items()[last_itemselected]->redraw(true); + last_itemselected = selected; + if (selected >= 1 + hasUpDir) { + const int8_t filenum = selected - 1 - hasUpDir; // Skip "Back" and ".." + card.getfilename_sorted(SD_ORDER(filenum, card.get_num_Files())); + make_name_without_ext(shift_name, card.longest_filename(), LONG_FILENAME_LENGTH); + shift_len = strlen(shift_name); + shift_amt = 0; + } + } + else if ((selected >= 1 + hasUpDir) && (shift_len > MENU_CHAR_LIMIT)) { + uint8_t shift_new = _MIN(shift_amt + 1, shift_len - MENU_CHAR_LIMIT); // Try to shift by... + Draw_SDItem_Shifted(shift_new); // Draw the item + if (shift_new == shift_amt) // Scroll reached the end + shift_new = -1; // Reset + shift_amt = shift_new; // Set new scroll + } + } +#else + char shift_name[FILENAME_LENGTH + 1] = ""; #endif -// Redraw the first set of SD Files -void Redraw_SD_List() { - select_file.reset(); - index_file = MROWS; - - DWINUI::ClearMainArea(); // Leave title bar unchanged - - Draw_Back_First(); +void onDrawFileName(MenuItemClass* menuitem, int8_t line) { + const bool is_subdir = !card.flag.workDirIsRoot; + if (is_subdir && menuitem->pos == 1) { + Draw_Menu_Line(line, ICON_Folder, ".."); + } + else { + uint8_t icon; + card.getfilename_sorted(SD_ORDER(menuitem->pos - is_subdir - 1, card.get_num_Files())); + make_name_without_ext(shift_name, card.longest_filename()); + icon = card.flag.filenameIsDir ? ICON_Folder : card.fileIsBinary() ? ICON_Binary : ICON_File; + Draw_Menu_Line(line, icon, shift_name); + } +} +void Draw_Print_File_Menu() { + checkkey = Menu; if (card.isMounted()) { - // As many files as will fit - LOOP_L_N(i, _MIN(nr_sd_menu_items(), MROWS)) - Draw_SDItem(i, i + 1); - - TERN_(SCROLL_LONG_FILENAMES, Init_SDItem_Shift()); + if (SET_MENU(FileMenu, MSG_MEDIA_MENU, nr_sd_menu_items() + 1)) { + BACK_ITEM(Goto_Main_Menu); + LOOP_L_N(i, nr_sd_menu_items()) { + MenuItemAdd(onDrawFileName, onClickSDItem); + } + } + UpdateMenu(FileMenu); + TERN_(DASH_REDRAW, DWIN_RedrawDash()); } else { + if (SET_MENU(FileMenu, MSG_MEDIA_MENU, 1)) BACK_ITEM(Goto_Main_Menu); + UpdateMenu(FileMenu); DWIN_Draw_Rectangle(1, HMI_data.AlertBg_Color, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4)); DWINUI::Draw_CenteredString(font12x24, HMI_data.AlertTxt_Color, MBASE(3), GET_TEXT_F(MSG_MEDIA_NOT_INSERTED)); } -} - -bool DWIN_lcd_sd_status = false; - -void SDCard_Up() { - card.cdup(); - Redraw_SD_List(); - DWIN_lcd_sd_status = false; // On next DWIN_Update -} - -void SDCard_Folder(char * const dirname) { - card.cd(dirname); - Redraw_SD_List(); - DWIN_lcd_sd_status = false; // On next DWIN_Update + TERN_(SCROLL_LONG_FILENAMES, FileMenuIdle(true)); } // @@ -1039,29 +1035,16 @@ void HMI_SDCardUpdate() { if (HMI_flag.home_flag) return; if (DWIN_lcd_sd_status != card.isMounted()) { DWIN_lcd_sd_status = card.isMounted(); - //SERIAL_ECHOLNPGM("HMI_SDCardUpdate: ", DWIN_lcd_sd_status); - if (DWIN_lcd_sd_status) { // Media inserted - if (checkkey == SelectFile) - Redraw_SD_List(); - } - else { // Media removed - // clean file icon - if (checkkey == SelectFile) { - Redraw_SD_List(); - } - else if (sdprint && card.isPrinting() && printingIsActive()) { - wait_for_heatup = wait_for_user = false; - HMI_flag.abort_flag = true; // Abort print - } - } + if (IsMenu(FileMenu)) Redraw_SD_List(); + if (!DWIN_lcd_sd_status && SD_Printing()) ui.abort_print(); // Media removed while printing DWIN_UpdateLCD(); } } -// -// The Dashboard is always on-screen, except during -// full-screen modal dialogs. -// +/** + * Dash board and indicators + */ + void DWIN_Draw_Dashboard() { DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, STATUS_Y + 21, DWIN_WIDTH, DWIN_HEIGHT - 1); @@ -1110,11 +1093,11 @@ void DWIN_Draw_Dashboard() { void Draw_Info_Menu() { DWINUI::ClearMainArea(); - Draw_Back_First(); if (HMI_IsChinese()) Title.FrameCopy(30, 17, 28, 13); // "Info" else Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); + Draw_Menu_Line(0, ICON_Back, GET_TEXT_F(MSG_BACK), false, true); if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 197, 149, 252, 161, 108, 102); // "Size" @@ -1137,15 +1120,6 @@ void Draw_Info_Menu() { } } -void Draw_Print_File_Menu() { - if (HMI_IsChinese()) - Title.FrameCopy(0, 31, 56, 14); // "Print file" - else - Title.ShowCaption(GET_TEXT_F(MSG_MEDIA_MENU)); - Redraw_SD_List(); - TERN_(DASH_REDRAW, DWIN_RedrawDash()); -} - // Main Process void HMI_MainMenu() { EncoderState encoder_diffState = get_encoder_state(); @@ -1174,9 +1148,10 @@ void HMI_MainMenu() { else if (encoder_diffState == ENCODER_DIFF_ENTER) { switch (select_page.now) { case PAGE_PRINT: - checkkey = SelectFile; - card.mount(); - safe_delay(300); + if (HMI_data.MediaAutoMount) { + card.mount(); + safe_delay(800); + }; Draw_Print_File_Menu(); break; case PAGE_PREPARE: Draw_Prepare_Menu(); break; @@ -1187,125 +1162,11 @@ void HMI_MainMenu() { DWIN_UpdateLCD(); } -// Select (and Print) File -void HMI_SelectFile() { - EncoderState encoder_diffState = get_encoder_state(); - - const uint16_t hasUpDir = !card.flag.workDirIsRoot; - - if (encoder_diffState == ENCODER_DIFF_NO) { - #if ENABLED(SCROLL_LONG_FILENAMES) - if (shift_ms && select_file.now >= 1 + hasUpDir) { - // Scroll selected filename every second - const millis_t ms = millis(); - if (ELAPSED(ms, shift_ms)) { - const bool was_reset = shift_amt < 0; - shift_ms = ms + 375UL + was_reset * 250UL; // ms per character - uint8_t shift_new = shift_amt + 1; // Try to shift by... - Draw_SDItem_Shifted(shift_new); // Draw the item - if (!was_reset && shift_new == 0) // Was it limited to 0? - shift_ms = 0; // No scrolling needed - else if (shift_new == shift_amt) // Scroll reached the end - shift_new = -1; // Reset - shift_amt = shift_new; // Set new scroll - } - } - #endif - return; - } - - // First pause is long. Easy. - // On reset, long pause must be after 0. - - const uint16_t fullCnt = nr_sd_menu_items(); - - if (encoder_diffState == ENCODER_DIFF_CW && fullCnt) { - if (select_file.inc(1 + fullCnt)) { - const uint8_t itemnum = select_file.now - 1; // -1 for "Back" - if (TERN0(SCROLL_LONG_FILENAMES, shift_ms)) { // If line was shifted - Erase_Menu_Text(itemnum + MROWS - index_file); // Erase and - Draw_SDItem(itemnum - 1); // redraw - } - if (select_file.now > MROWS && select_file.now > index_file) { // Cursor past the bottom - index_file = select_file.now; // New bottom line - Scroll_Menu(DWIN_SCROLL_UP); - Draw_SDItem(itemnum, MROWS); // Draw and init the shift name - } - else { - Move_Highlight(1, select_file.now + MROWS - index_file); // Just move highlight - TERN_(SCROLL_LONG_FILENAMES, Init_Shift_Name()); // ...and init the shift name - } - TERN_(SCROLL_LONG_FILENAMES, Init_SDItem_Shift()); - } - } - else if (encoder_diffState == ENCODER_DIFF_CCW && fullCnt) { - if (select_file.dec()) { - const uint8_t itemnum = select_file.now - 1; // -1 for "Back" - if (TERN0(SCROLL_LONG_FILENAMES, shift_ms)) { // If line was shifted - Erase_Menu_Text(select_file.now + 1 + MROWS - index_file); // Erase and - Draw_SDItem(itemnum + 1); // redraw - } - if (select_file.now < index_file - MROWS) { // Cursor past the top - index_file--; // New bottom line - Scroll_Menu(DWIN_SCROLL_DOWN); - if (index_file == MROWS) { - Draw_Back_First(); - TERN_(SCROLL_LONG_FILENAMES, shift_ms = 0); - } - else { - Draw_SDItem(itemnum, 0); // Draw the item (and init shift name) - } - } - else { - Move_Highlight(-1, select_file.now + MROWS - index_file); // Just move highlight - TERN_(SCROLL_LONG_FILENAMES, Init_Shift_Name()); // ...and init the shift name - } - TERN_(SCROLL_LONG_FILENAMES, Init_SDItem_Shift()); // Reset left. Init timer. - } - } - else if (encoder_diffState == ENCODER_DIFF_ENTER) { - if (select_file.now == 0) { // Back - select_page.set(PAGE_PRINT); - return Goto_Main_Menu(); - } - else if (hasUpDir && select_file.now == 1) { // CD-Up - SDCard_Up(); - goto HMI_SelectFileExit; - } - else { - const uint16_t filenum = select_file.now - 1 - hasUpDir; - card.getfilename_sorted(SD_ORDER(filenum, card.get_num_Files())); - - // Enter that folder! - if (card.flag.filenameIsDir) { - SDCard_Folder(card.filename); - goto HMI_SelectFileExit; - } - - // Reset highlight for next entry - select_print.reset(); - select_file.reset(); - - // Start choice and print SD file - HMI_flag.heat_flag = true; - HMI_flag.print_finish = false; - - if (card.fileIsBinary()) - return DWIN_Popup_Confirm(ICON_Error, F("Please check filenames"), F("Only G-code can be printed")); - else - return Goto_ConfirmToPrint(); - } - } - - HMI_SelectFileExit: - DWIN_UpdateLCD(); -} - // Pause or Stop popup void onClick_PauseOrStop() { switch (select_print.now) { - case PRINT_PAUSE_RESUME: if (HMI_flag.select_flag) HMI_flag.pause_flag = true; break; // confirm pause - case PRINT_STOP: if (HMI_flag.select_flag) HMI_flag.abort_flag = true; break; // stop confirmed then abort print + case PRINT_PAUSE_RESUME: if (HMI_flag.select_flag) ui.pause_print(); break; // confirm pause + case PRINT_STOP: if (HMI_flag.select_flag) ui.abort_print(); break; // stop confirmed then abort print default: break; } return Goto_PrintProcess(); @@ -1357,7 +1218,6 @@ void HMI_Printing() { void Draw_Main_Area() { switch (checkkey) { case MainMenu: Draw_Main_Menu(); break; - case SelectFile: Draw_Print_File_Menu(); break; case PrintProcess: Draw_PrintProcess(); break; case PrintDone: Draw_PrintDone(); break; #if HAS_ESDIAG @@ -1384,27 +1244,35 @@ void HMI_ReturnScreen() { } void HMI_WaitForUser() { - get_encoder_state(); + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState != ENCODER_DIFF_NO && !ui.backlight) { + if (checkkey == WaitResponse) HMI_ReturnScreen(); + return ui.refresh_brightness(); + } if (!wait_for_user) { switch (checkkey) { case PrintDone: select_page.reset(); Goto_Main_Menu(); break; - TERN_(HAS_ONESTEP_LEVELING, case Leveling:) - default: HMI_ReturnScreen(); break; + #if HAS_BED_PROBE + case Leveling: + #endif + default: + HMI_ReturnScreen(); + break; } } } void HMI_Init() { - DWINUI::Draw_Box(1, Color_Black, {5, 220, DWIN_WIDTH-5, DWINUI::fontHeight()}); + DWINUI::Draw_Box(1, Color_Black, { 5, 220, DWIN_WIDTH - 5, DWINUI::fontHeight() }); DWINUI::Draw_CenteredString(Color_White, 220, F("Professional Firmware ")); - for (uint16_t t = 0; t <= 100; t += 2) { + for (uint16_t t = 15; t <= 257; t += 10) { DWINUI::Draw_Icon(ICON_Bar, 15, 260); - DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 15 + t * 242 / 100, 260, 257, 280); + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, t, 260, 257, 280); DWIN_UpdateLCD(); - delay(20); + delay(50); } HMI_SetLanguage(); } @@ -1415,12 +1283,13 @@ void EachMomentUpdate() { if (ELAPSED(ms, next_var_update_ms)) { next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; + blink = !blink; update_variable(); #if HAS_ESDIAG if (checkkey == ESDiagProcess) ESDiag.Update(); #endif #if HAS_PIDPLOT - if (checkkey == PidProcess) Plot.Update((HMI_value.pidresult == PID_EXTR_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); + if (checkkey == PidProcess) Plot.Update((HMI_value.pidresult == PIDTEMP_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); #endif } @@ -1433,73 +1302,73 @@ void EachMomentUpdate() { if (ELAPSED(ms, next_status_update_ms)) { next_status_update_ms = ms + 500; DWIN_DrawStatusMessage(); + #if ENABLED(SCROLL_LONG_FILENAMES) + if (IsMenu(FileMenu)) FileMenuIdle(); + #endif } - if (PENDING(ms, next_rts_update_ms)) return; - next_rts_update_ms = ms + DWIN_SCROLL_UPDATE_INTERVAL; - - if (checkkey == PrintProcess) { // print process + if (!PENDING(ms, next_rts_update_ms)) { + next_rts_update_ms = ms + DWIN_UPDATE_INTERVAL; - // Print pause - if (HMI_flag.pause_flag && !HMI_flag.home_flag) { - HMI_flag.pause_flag = false; - if (!HMI_flag.pause_action) { - HMI_flag.pause_action = true; - return ui.pause_print(); - } + if ((Printing() != HMI_flag.printing_flag) && !HMI_flag.home_flag) { + HMI_flag.printing_flag = Printing(); + DEBUG_ECHOLNPGM("printing_flag: ", HMI_flag.printing_flag); + if (HMI_flag.printing_flag) + DWIN_Print_Started(); + else if (HMI_flag.abort_flag) + DWIN_Print_Aborted(); + else + DWIN_Print_Finished(); } - // if print done - if (HMI_flag.print_finish && !HMI_flag.home_flag) { - HMI_flag.print_finish = false; - return DWIN_Print_Finished(); + if ((printingIsPaused() != HMI_flag.pause_flag) && !HMI_flag.home_flag) { + HMI_flag.pause_flag = printingIsPaused(); + DEBUG_ECHOLNPGM("pause_flag: ", HMI_flag.pause_flag); + if (HMI_flag.pause_flag) + DWIN_Print_Pause(); + else if (HMI_flag.abort_flag) + DWIN_Print_Aborted(); + else + DWIN_Print_Resume(); } - // if print was aborted - if (HMI_flag.abort_flag && !HMI_flag.home_flag) { // Print Stop - HMI_flag.abort_flag = false; - if (!HMI_flag.abort_action) { - HMI_flag.abort_action = true; - ui.abort_print(); - return Goto_PrintDone(); - } - } + if (checkkey == PrintProcess) { // print process + + duration_t elapsed = print_job_timer.duration(); // print timer - duration_t elapsed = print_job_timer.duration(); // print timer + if (card.isPrinting() && !HMI_flag.percent_flag) { + uint8_t percentDone = card.percentDone(); + if (_percent_done != percentDone) { // print percent + _percent_done = percentDone; + Draw_Print_ProgressBar(); + } - if (sdprint && card.isPrinting() && !HMI_flag.percent_flag) { - uint8_t percentDone = card.percentDone(); - if (_percent_done != percentDone) { // print percent - _percent_done = percentDone; - Draw_Print_ProgressBar(); + // Estimate remaining time every 20 seconds + static millis_t next_remain_time_update = 0; + if (_percent_done > 1 && ELAPSED(ms, next_remain_time_update) && !HMI_flag.heat_flag && !HMI_flag.remain_flag) { + _remain_time = (elapsed.value - dwin_heat_time) / (_percent_done * 0.01f) - (elapsed.value - dwin_heat_time); + next_remain_time_update += DWIN_REMAIN_TIME_UPDATE_INTERVAL; + Draw_Print_ProgressRemain(); } + } - // Estimate remaining time every 20 seconds - static millis_t next_remain_time_update = 0; - if (_percent_done > 1 && ELAPSED(ms, next_remain_time_update) && !HMI_flag.heat_flag && !HMI_flag.remain_flag) { - _remain_time = (elapsed.value - dwin_heat_time) / (_percent_done * 0.01f) - (elapsed.value - dwin_heat_time); - next_remain_time_update += DWIN_REMAIN_TIME_UPDATE_INTERVAL; - Draw_Print_ProgressRemain(); + // Print time so far + static uint16_t last_Printtime = 0; + const uint16_t min = (elapsed.value % 3600) / 60; + if (last_Printtime != min) { // 1 minute update + last_Printtime = min; + Draw_Print_ProgressElapsed(); } - } - // Print time so far - static uint16_t last_Printtime = 0; - const uint16_t min = (elapsed.value % 3600) / 60; - if (last_Printtime != min) { // 1 minute update - last_Printtime = min; - Draw_Print_ProgressElapsed(); } + #if ENABLED(POWER_LOSS_RECOVERY) + else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off + return Goto_PowerLossRecovery(); + } + #endif // POWER_LOSS_RECOVERY + DWIN_UpdateLCD(); } - - #if ENABLED(POWER_LOSS_RECOVERY) - else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off - return Goto_PowerLossRecovery(); - } - #endif // POWER_LOSS_RECOVERY - - DWIN_UpdateLCD(); } #if ENABLED(POWER_LOSS_RECOVERY) @@ -1536,8 +1405,6 @@ void EachMomentUpdate() { else { select_print.set(PRINT_SETUP); queue.inject(F("M1000")); - sdprint = true; - return Goto_PrintProcess(); } } @@ -1554,12 +1421,11 @@ void DWIN_HandleScreen() { switch (checkkey) { case MainMenu: HMI_MainMenu(); break; case Menu: HMI_Menu(); break; - case SetInt: HMI_SetInt(); break; + case SetInt: HMI_SetDraw(); break; + case SetFloat: HMI_SetDraw(); break; case SetPInt: HMI_SetPInt(); break; - case SetIntNoDraw: HMI_SetIntNoDraw(); break; - case SetFloat: HMI_SetFloat(); break; case SetPFloat: HMI_SetPFloat(); break; - case SelectFile: HMI_SelectFile(); break; + case SetIntNoDraw: HMI_SetNoDraw(); break; case PrintProcess: HMI_Printing(); break; case Popup: HMI_Popup(); break; case Leveling: break; @@ -1607,15 +1473,15 @@ void DWIN_HomingStart() { void DWIN_HomingDone() { HMI_flag.home_flag = false; - #if ENABLED(MESH_BED_LEVELING) && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) + #if DISABLED(HAS_BED_PROBE) && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) planner.synchronize(); babystep.add_mm(Z_AXIS, HMI_data.ManualZOffset); #endif - if (HMI_flag.abort_action) DWIN_Print_Aborted(); else HMI_ReturnScreen(); + HMI_ReturnScreen(); } void DWIN_LevelingStart() { - #if HAS_ONESTEP_LEVELING + #if HAS_BED_PROBE HMI_SaveProcessID(Leveling); Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); DWIN_Show_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); @@ -1641,10 +1507,10 @@ void DWIN_LevelingDone() { } #if HAS_MESH - void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { + void DWIN_MeshUpdate(const int8_t cpos, const int8_t tpos, const_float_t zval) { char msg[33] = ""; char str_1[6] = ""; - sprintf_P(msg, PSTR(S_FMT " %i/%i Z=%s"), GET_TEXT(MSG_PROBING_POINT), xpos, ypos, dtostrf(zval, 1, 2, str_1)); + sprintf_P(msg, PSTR(S_FMT " %i/%i Z=%s"), GET_TEXT(MSG_PROBING_POINT), cpos, tpos, dtostrf(zval, 1, 2, str_1)); ui.set_status(msg); } #endif @@ -1659,96 +1525,102 @@ void DWIN_LevelingDone() { DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); switch (HMI_value.pidresult) { - case PID_EXTR_START: - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); - Plot.Draw(gfrm, thermalManager.hotend_maxtemp[0], HMI_data.HotendPidT); - DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.HotendPidT); - break; - case PID_BED_START: - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); - Plot.Draw(gfrm, BED_MAXTEMP, HMI_data.BedPidT); - DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.BedPidT); - break; - default: - break; + #if ENABLED(PIDTEMP) + case PIDTEMP_START: + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); + Plot.Draw(gfrm, thermalManager.hotend_maxtemp[0], HMI_data.HotendPidT); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.HotendPidT); + break; + #endif + #if ENABLED(PIDTEMPBED) + case PIDTEMPBED_START: + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); + Plot.Draw(gfrm, BED_MAXTEMP, HMI_data.BedPidT); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.BedPidT); + break; + #endif + default: break; } } #endif -void DWIN_PidTuning(pidresult_t result) { - HMI_value.pidresult = result; - switch (result) { - case PID_BED_START: - HMI_SaveProcessID(PidProcess); - #if HAS_PIDPLOT - DWIN_Draw_PIDPopup(); - #else - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); +#if EITHER(PIDTEMP, PIDTEMPBED) + + void DWIN_PidTuning(pidresult_t result) { + HMI_value.pidresult = result; + switch (result) { + #if ENABLED(PIDTEMP) + case PIDTEMP_START: + HMI_SaveProcessID(PidProcess); + #if HAS_PIDPLOT + DWIN_Draw_PIDPopup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + #endif + break; + case PID_BAD_EXTRUDER_NUM: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_EXTRUDER_NUM)); + break; #endif - break; - case PID_EXTR_START: - HMI_SaveProcessID(PidProcess); - #if HAS_PIDPLOT - DWIN_Draw_PIDPopup(); - #else - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + #if ENABLED(PIDTEMPBED) + case PIDTEMPBED_START: + HMI_SaveProcessID(PidProcess); + #if HAS_PIDPLOT + DWIN_Draw_PIDPopup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); + #endif + break; #endif - break; - case PID_BAD_EXTRUDER_NUM: - checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_EXTRUDER_NUM)); - break; - case PID_TUNING_TIMEOUT: - checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); - break; - case PID_TEMP_TOO_HIGH: - checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); - break; - case PID_DONE: - checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); - break; - default: - checkkey = last_checkkey; - break; + case PID_TUNING_TIMEOUT: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); + break; + case PID_TEMP_TOO_HIGH: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); + break; + case PID_DONE: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); + break; + default: checkkey = last_checkkey; break; + } } -} + +#endif // PIDTEMP || PIDTEMPBED // Started a Print Job -void DWIN_Print_Started(const bool sd) { - sdprint = IS_SD_PRINTING() || sd; +void DWIN_Print_Started() { + DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing()); + TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) Preview_Invalidate()); _percent_done = 0; _remain_time = 0; HMI_flag.percent_flag = false; HMI_flag.remain_flag = false; HMI_flag.pause_flag = false; - HMI_flag.pause_action = false; HMI_flag.abort_flag = false; - HMI_flag.abort_action = false; - HMI_flag.print_finish = false; + select_print.reset(); Goto_PrintProcess(); } // Pause a print job void DWIN_Print_Pause() { + DEBUG_ECHOLNPGM("DWIN_Print_Pause"); ICON_ResumeOrPause(); } // Resume print job void DWIN_Print_Resume() { - HMI_flag.pause_action = false; + DEBUG_ECHOLNPGM("DWIN_Print_Resume"); ICON_ResumeOrPause(); - if (printJobOngoing()) { - LCD_MESSAGE(MSG_RESUME_PRINT); - Goto_PrintProcess(); - } + LCD_MESSAGE(MSG_RESUME_PRINT); } // Ended print job void DWIN_Print_Finished() { - if (HMI_flag.abort_flag || checkkey == PrintDone) return; + DEBUG_ECHOLNPGM("DWIN_Print_Finished"); TERN_(POWER_LOSS_RECOVERY, if (card.isPrinting()) recovery.cancel()); HMI_flag.pause_flag = false; wait_for_heatup = false; @@ -1759,12 +1631,8 @@ void DWIN_Print_Finished() { // Print was aborted void DWIN_Print_Aborted() { - TERN_(DEBUG_DWIN, SERIAL_ECHOLNPGM("DWIN_Print_Aborted")); - HMI_flag.abort_action = false; - wait_for_heatup = false; - planner.finish_and_disable(); - thermalManager.cooldown(); - Goto_PrintDone(); + DEBUG_ECHOLNPGM("DWIN_Print_Aborted"); + DWIN_Print_Finished(); } // Progress and remaining time update @@ -1791,16 +1659,16 @@ void DWIN_M73() { void DWIN_SetColorDefaults() { HMI_data.Background_Color = Def_Background_Color; - HMI_data.Cursor_color = Def_Cursor_color; - HMI_data.TitleBg_color = Def_TitleBg_color; - HMI_data.TitleTxt_color = Def_TitleTxt_color; + HMI_data.Cursor_Color = Def_Cursor_Color; + HMI_data.TitleBg_Color = Def_TitleBg_Color; + HMI_data.TitleTxt_Color = Def_TitleTxt_Color; HMI_data.Text_Color = Def_Text_Color; HMI_data.Selected_Color = Def_Selected_Color; HMI_data.SplitLine_Color = Def_SplitLine_Color; HMI_data.Highlight_Color = Def_Highlight_Color; HMI_data.StatusBg_Color = Def_StatusBg_Color; HMI_data.StatusTxt_Color = Def_StatusTxt_Color; - HMI_data.PopupBg_color = Def_PopupBg_color; + HMI_data.PopupBg_Color = Def_PopupBg_Color; HMI_data.PopupTxt_Color = Def_PopupTxt_Color; HMI_data.AlertBg_Color = Def_AlertBg_Color; HMI_data.AlertTxt_Color = Def_AlertTxt_Color; @@ -1811,19 +1679,24 @@ void DWIN_SetColorDefaults() { } void DWIN_SetDataDefaults() { + DEBUG_ECHOLNPGM("DWIN_SetDataDefaults"); DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); - TERN_(HAS_HOTEND, HMI_data.HotendPidT = PREHEAT_1_TEMP_HOTEND); - TERN_(HAS_HEATED_BED, HMI_data.BedPidT = PREHEAT_1_TEMP_BED); - TERN_(HAS_HOTEND, HMI_data.PidCycles = 5); + TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT); + TERN_(PIDTEMPBED, HMI_data.BedPidT = DEF_BEDPIDT); + TERN_(HAS_PID_HEATING, HMI_data.PidCycles = DEF_PIDCYCLES); #if ENABLED(PREVENT_COLD_EXTRUSION) HMI_data.ExtMinT = EXTRUDE_MINTEMP; ApplyExtMinT(); #endif - #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) - HMI_data.BedLevT = LEVELING_BED_TEMP; - #endif + TERN_(PREHEAT_BEFORE_LEVELING, HMI_data.BedLevT = LEVELING_BED_TEMP); TERN_(BAUD_RATE_GCODE, SetBaud250K()); + HMI_data.FullManualTramming = false; + HMI_data.MediaAutoMount = ENABLED(HAS_SD_EXTENDER); + #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) + HMI_data.z_after_homing = DEF_Z_AFTER_HOMING; + #endif + IF_DISABLED(HAS_BED_PROBE, HMI_data.ManualZOffset = 0); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) TERN_(LED_COLOR_PRESETS, leds.set_default()); ApplyLEDColor(); @@ -1831,10 +1704,13 @@ void DWIN_SetDataDefaults() { } void DWIN_CopySettingsTo(char * const buff) { + DEBUG_ECHOLNPGM("DWIN_CopySettingsTo"); + DEBUG_ECHOLNPGM("HMI_data: ", sizeof(HMI_data_t)); memcpy(buff, &HMI_data, eeprom_data_size); } void DWIN_CopySettingsFrom(const char * const buff) { + DEBUG_ECHOLNPGM("DWIN_CopySettingsFrom"); memcpy(&HMI_data, buff, sizeof(HMI_data_t)); if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); @@ -1855,22 +1731,25 @@ void DWIN_CopySettingsFrom(const char * const buff) { // Initialize or re-initialize the LCD void MarlinUI::init_lcd() { - TERN_(DEBUG_DWIN, SERIAL_ECHOLNPGM("DWIN_Startup")); - DWINUI::init(); + DEBUG_ECHOLNPGM("MarlinUI::init_lcd"); + delay(750); // wait to wakeup screen + const bool hs = DWIN_Handshake(); UNUSED(hs); + DEBUG_ECHOPGM("DWIN_Handshake "); + DEBUG_ECHOLNF(hs ? F("ok.") : F("error.")); + DWIN_Frame_SetDir(1); DWIN_JPG_CacheTo1(Language_English); Encoder_Configuration(); } void DWIN_InitScreen() { + DEBUG_ECHOLNPGM("DWIN_InitScreen"); + DWIN_SetColorDefaults(); HMI_Init(); // draws boot screen - onCursorDraw = Draw_Menu_Cursor; - onCursorErase = Erase_Menu_Cursor; + DWINUI::init(); + DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); DWINUI::onTitleDraw = Draw_Title; - onMenuDraw = Draw_Menu; + InitMenu(); checkkey = 255; - CurrentMenu = nullptr; - PreviousMenu = nullptr; - index_file = MROWS; hash_changed = true; last_E = 0; DWIN_DrawStatusLine(); @@ -1925,12 +1804,12 @@ void DWIN_RedrawScreen() { //if (mode == PAUSE_MODE_SAME) return; pause_mode = mode; switch (message) { - case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 - case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) + case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 + case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; case PAUSE_MESSAGE_INSERT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break; case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 + case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 case PAUSE_MESSAGE_PURGE: #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE)); @@ -1942,7 +1821,7 @@ void DWIN_RedrawScreen() { case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; case PAUSE_MESSAGE_HEATING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break; // Exit from Pause, Load and Unload + case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break; // Exit from Pause, Load and Unload default: break; } } @@ -1955,13 +1834,13 @@ void DWIN_RedrawScreen() { } void onClick_FilamentPurge() { - if (HMI_flag.select_flag) - pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // "Purge More" button - else { - HMI_SaveProcessID(NothingToDo); - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // "Continue" button - } + if (HMI_flag.select_flag) + pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // "Purge More" button + else { + HMI_SaveProcessID(NothingToDo); + pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // "Continue" button } + } void Goto_FilamentPurge() { pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; @@ -2011,15 +1890,14 @@ void DWIN_RedrawScreen() { #if HAS_GCODE_PREVIEW void onClick_ConfirmToPrint() { + Preview_Reset(); + DWIN_ResetStatusLine(); if (HMI_flag.select_flag) { // Confirm - card.openAndPrintFile(card.filename); - return DWIN_Print_Started(true); - } - else { // Cancel - DWIN_ResetStatusLine(); - checkkey = SelectFile; - return Draw_Print_File_Menu(); + HMI_flag.heat_flag = true; + Goto_Main_Menu(); + return card.openAndPrintFile(card.filename); } + else HMI_ReturnScreen(); } void Goto_ConfirmToPrint() { @@ -2028,8 +1906,9 @@ void DWIN_RedrawScreen() { #else void Goto_ConfirmToPrint() { + // Print SD file + HMI_flag.heat_flag = true; card.openAndPrintFile(card.filename); - DWIN_Print_Started(true); } #endif @@ -2048,8 +1927,7 @@ void DWIN_RedrawScreen() { #if ENABLED(EEPROM_SETTINGS) void WriteEeprom() { - ui.set_status(GET_TEXT_F(MSG_STORE_EEPROM)); - DWIN_DrawStatusLine(); + DWIN_DrawStatusLine(GET_TEXT_F(MSG_STORE_EEPROM)); DWIN_UpdateLCD(); DONE_BUZZ(settings.save()); } @@ -2086,13 +1964,6 @@ void Goto_Info_Menu() { HMI_SaveProcessID(WaitResponse); } -void Goto_Move_Menu() { - #if HAS_HOTEND - gcode.process_subcommands_now(F("G92E0")); // reset extruder position - #endif - Draw_Move_Menu(); -} - void DisableMotors() { queue.inject(F("M84")); } void AutoLev() { // Always reacquire the Z "home" position @@ -2100,15 +1971,22 @@ void AutoLev() { // Always reacquire the Z "home" position } void AutoHome() { queue.inject_P(G28_STR); } -void HomeX() { queue.inject(F("G28X")); } -void HomeY() { queue.inject(F("G28Y")); } -void HomeZ() { queue.inject(F("G28Z")); } + +#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + void HomeX() { queue.inject(F("G28X")); } + void HomeY() { queue.inject(F("G28Y")); } + void HomeZ() { queue.inject(F("G28Z")); } + #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) + void ApplyZAfterHoming() { HMI_data.z_after_homing = MenuData.Value; }; + void SetZAfterHoming() { SetIntOnClick(0, 20, HMI_data.z_after_homing, ApplyZAfterHoming); } + #endif +#endif #if HAS_HOME_OFFSET // Apply workspace offset, making the current position 0,0,0 void SetHome() { - queue.inject(F("G92X0Y0Z0")); - DONE_BUZZ(true); + queue.inject(F("G92X0Y0Z0")); + DONE_BUZZ(true); } #endif @@ -2119,15 +1997,15 @@ void HomeZ() { queue.inject(F("G28Z")); } #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) const_float_t step_zoffset = round((MenuData.Value / 100.0f) * planner.settings.axis_steps_per_mm[Z_AXIS]) - babystep.accum; if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset); + //DEBUG_ECHOLNF(F("BB Steps: "), step_zoffset); #endif } - - #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - void SetZOffset() { + void SetZOffset() { + #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR); - SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset); - } - #endif + #endif + SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset); + } void SetMoveZto0() { #if ENABLED(Z_SAFE_HOMING) @@ -2139,7 +2017,7 @@ void HomeZ() { queue.inject(F("G28Z")); } gcode.process_subcommands_now(cmd); #else TERN_(HAS_LEVELING, set_bed_leveling_enabled(false)); - gcode.process_subcommands_now(F("G28O\nG0Z0F300\nM400")); + gcode.process_subcommands_now(F("G28Z\nG0Z0F300\nM400")); #endif ui.reset_status(); DONE_BUZZ(true); @@ -2155,13 +2033,9 @@ void HomeZ() { queue.inject(F("G28Z")); } #endif // HAS_ZOFFSET_ITEM #if HAS_PREHEAT - void DoPreheat0() { ui.preheat_all(0); } - #if PREHEAT_COUNT >= 2 - void DoPreheat1() { ui.preheat_all(1); } - #if PREHEAT_COUNT >= 3 - void DoPreheat2() { ui.preheat_all(2); } - #endif - #endif + #define _DoPreheat(N) void DoPreheat##N() { ui.preheat_all(N-1); }\ + void DoPreheatHotend##N() { ui.preheat_hotend(N-1); } + REPEAT_1(PREHEAT_COUNT, _DoPreheat) #endif void DoCoolDown() { thermalManager.cooldown(); } @@ -2172,56 +2046,55 @@ void SetLanguage() { Draw_Prepare_Menu(); } +bool EnableLiveMove = false; +void SetLiveMove() { Toogle_Chkb_Line(EnableLiveMove); } void LiveMove() { + planner.synchronize(); + if (!EnableLiveMove) return; *MenuData.P_Float = MenuData.Value / MINUNITMULT; - if (!planner.is_full()) { - planner.synchronize(); - planner.buffer_line(current_position, homing_feedrate(HMI_value.axis)); - } + if (!planner.is_full()) planner.buffer_line(current_position, manual_feedrate_mm_s[HMI_value.axis]); } -void ApplyMoveE() { - last_E = MenuData.Value / MINUNITMULT; - if (!planner.is_full()) { - planner.synchronize(); - planner.buffer_line(current_position, MMM_TO_MMS(FEEDRATE_E)); - } +void ApplyMove() { + planner.synchronize(); + if (EnableLiveMove) return; + if (HMI_value.axis == E_AXIS) last_E = MenuData.Value / MINUNITMULT; + if (!planner.is_full()) planner.buffer_line(current_position, manual_feedrate_mm_s[HMI_value.axis]); } -void SetMoveX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(X_MIN_POS, X_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } -void SetMoveY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } -void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } + +void SetMoveX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(X_MIN_POS, X_MAX_POS, UNITFDIGITS, ApplyMove, LiveMove); } +void SetMoveY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, ApplyMove, LiveMove); } +void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, ApplyMove, LiveMove); } #if HAS_HOTEND void SetMoveE() { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(0)) - return DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT)); - #endif - SetPFloatOnClick(last_E - (EXTRUDE_MAXLENGTH), last_E + (EXTRUDE_MAXLENGTH), UNITFDIGITS, ApplyMoveE); + if (thermalManager.tooColdToExtrude(0)) return DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT)); + HMI_value.axis = E_AXIS; SetPFloatOnClick(E_MIN_POS, E_MAX_POS, UNITFDIGITS, ApplyMove, LiveMove); } #endif -void SetPID(celsius_t t, heater_id_t h) { - char cmd[53] = ""; - char str_1[5] = "", str_2[5] = ""; - sprintf_P(cmd, PSTR("G28OXY\nG0Z5F300\nG0X%sY%sF5000\nM84\nM400"), - dtostrf(X_CENTER, 1, 1, str_1), - dtostrf(Y_CENTER, 1, 1, str_2) - ); - gcode.process_subcommands_now(cmd); - thermalManager.PID_autotune(t, h, HMI_data.PidCycles, true); -} -#if HAS_HOTEND - void HotendPID() { SetPID(HMI_data.HotendPidT, H_E0); } -#endif -#if HAS_HEATED_BED - void BedPID() { SetPID(HMI_data.BedPidT, H_BED); } +#if EITHER(PIDTEMP, PIDTEMPBED) + void SetPID(celsius_t t, heater_id_t h) { + char cmd[53] = ""; + char str_1[5] = "", str_2[5] = ""; + sprintf_P(cmd, PSTR("G28OXY\nG0Z5F300\nG0X%sY%sF5000\nM84\nM400"), + dtostrf(X_CENTER, 1, 1, str_1), + dtostrf(Y_CENTER, 1, 1, str_2) + ); + gcode.process_subcommands_now(cmd); + thermalManager.PID_autotune(t, h, HMI_data.PidCycles, true); + } + #if ENABLED(PIDTEMP) + void HotendPID() { SetPID(HMI_data.HotendPidT, H_E0); } + #endif + #if ENABLED(PIDTEMPBED) + void BedPID() { SetPID(HMI_data.BedPidT, H_BED); } + #endif #endif #if ENABLED(POWER_LOSS_RECOVERY) void SetPwrLossr() { - recovery.enable(!recovery.enabled); - Draw_Chkb_Line(CurrentMenu->line(), recovery.enabled); - DWIN_UpdateLCD(); + Toogle_Chkb_Line(recovery.enabled); + recovery.changed(); } #endif @@ -2246,10 +2119,8 @@ void SetPID(celsius_t t, heater_id_t h) { #if ENABLED(CASE_LIGHT_MENU) void SetCaseLight() { - caselight.on = !caselight.on; + Toogle_Chkb_Line(caselight.on); caselight.update_enabled(); - Draw_Chkb_Line(CurrentMenu->line(), caselight.on); - DWIN_UpdateLCD(); } #if ENABLED(CASELIGHT_USES_BRIGHTNESS) void LiveCaseLightBrightness() { caselight.brightness = MenuData.Value; caselight.update_brightness(); } @@ -2261,8 +2132,7 @@ void SetPID(celsius_t t, heater_id_t h) { #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) void SetLedStatus() { leds.toggle(); - Draw_Chkb_Line(CurrentMenu->line(), leds.lights_on); - DWIN_UpdateLCD(); + Show_Chkb_Line(leds.lights_on); } #endif #if HAS_COLOR_LEDS @@ -2285,9 +2155,7 @@ void SetPID(celsius_t t, heater_id_t h) { #if ENABLED(SOUND_MENU_ITEM) void SetEnableSound() { - ui.sound_on = !ui.sound_on; - Draw_Chkb_Line(CurrentMenu->line(), ui.sound_on); - DWIN_UpdateLCD(); + Toogle_Chkb_Line(ui.sound_on); } #endif @@ -2309,11 +2177,9 @@ void SetPID(celsius_t t, heater_id_t h) { void ProbeStow() { probe.stow(); } void ProbeDeploy() { probe.deploy(); } - #ifdef BLTOUCH_HS_MODE + #if ENABLED(BLTOUCH_HS_MODE) void SetHSMode() { - bltouch.high_speed_mode = !bltouch.high_speed_mode; - Draw_Chkb_Line(CurrentMenu->line(), bltouch.high_speed_mode); - DWIN_UpdateLCD(); + Toogle_Chkb_Line(bltouch.high_speed_mode); } #endif @@ -2322,9 +2188,7 @@ void SetPID(celsius_t t, heater_id_t h) { #if HAS_FILAMENT_SENSOR void SetRunoutEnable() { runout.reset(); - runout.enabled = !runout.enabled; - Draw_Chkb_Line(CurrentMenu->line(), runout.enabled); - DWIN_UpdateLCD(); + Toogle_Chkb_Line(runout.enabled); } #if HAS_FILAMENT_RUNOUT_DISTANCE void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); } @@ -2342,7 +2206,7 @@ void SetPID(celsius_t t, heater_id_t h) { void SetExtMinT() { SetPIntOnClick(MIN_ETEMP, MAX_ETEMP, ApplyExtMinT); } #endif -void RestoreDefaultsColors() { +void RestoreDefaultColors() { DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); DWIN_RedrawScreen(); @@ -2362,7 +2226,7 @@ void LiveRGBColor() { DWIN_Draw_Rectangle(1, color, 20, 315, DWIN_WIDTH - 20, 335); } void SetRGBColor() { - const uint8_t color = CurrentMenu->SelectedItem()->icon; + const uint8_t color = static_cast(CurrentMenu->SelectedItem())->icon; SetIntOnClick(0, (color == 1) ? 63 : 31, HMI_value.Color[color], nullptr, LiveRGBColor); } @@ -2399,10 +2263,12 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } queue.inject(F("M600 B2")); } - void ParkHead() { - LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED); - queue.inject(F("G28O\nG27")); - } + #if ENABLED(NOZZLE_PARK_FEATURE) + void ParkHead() { + LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED); + queue.inject(F("G28O\nG27")); + } + #endif #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) void UnloadFilament() { @@ -2418,8 +2284,7 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } #endif // ADVANCED_PAUSE_FEATURE -void ApplyFlow() { planner.refresh_e_factor(0); } -void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); } +void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, []{ planner.refresh_e_factor(0); }); } // Bed Tramming @@ -2522,14 +2387,14 @@ void TramBR() { Tram(2); } void TramBL() { Tram(3); } void TramC () { Tram(4); } -#if HAS_BED_PROBE +#if HAS_BED_PROBE && HAS_MESH void Trammingwizard() { - bed_mesh_t zval = {0}; if (HMI_data.FullManualTramming) { LCD_MESSAGE_F("Disable manual tramming"); return; } + bed_mesh_t zval = {0}; zval[0][0] = Tram(0); checkkey = NothingToDo; MeshViewer.DrawMesh(zval, 2, 2); @@ -2585,12 +2450,10 @@ void TramC () { Tram(4); } } void SetManualTramming() { - HMI_data.FullManualTramming = !HMI_data.FullManualTramming; - Draw_Chkb_Line(CurrentMenu->line(), HMI_data.FullManualTramming); - DWIN_UpdateLCD(); + Toogle_Chkb_Line(HMI_data.FullManualTramming); } -#endif // HAS_BED_PROBE +#endif // HAS_BED_PROBE && HAS_MESH #if ENABLED(MESH_BED_LEVELING) @@ -2607,7 +2470,7 @@ void TramC () { Tram(4); } *MenuData.P_Float = MenuData.Value / POW(10, 2); if (!planner.is_full()) { planner.synchronize(); - planner.buffer_line(current_position, homing_feedrate(Z_AXIS)); + planner.buffer_line(current_position, manual_feedrate_mm_s[Z_AXIS]); } } void SetMMeshMoveZ() { SetPFloatOnClick(-1, 1, 2, planner.synchronize, LiveMeshMoveZ); } @@ -2680,11 +2543,11 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP void SetKp() { SetPFloatOnClick(0, 1000, 2); } void ApplyPIDi() { *MenuData.P_Float = scalePID_i(MenuData.Value / POW(10, 2)); - thermalManager.updatePID(); + TERN_(PIDTEMP, thermalManager.updatePID()); } void ApplyPIDd() { *MenuData.P_Float = scalePID_d(MenuData.Value / POW(10, 2)); - thermalManager.updatePID(); + TERN_(PIDTEMP, thermalManager.updatePID()); } void SetKi() { MenuData.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; @@ -2847,8 +2710,10 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { } -void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } -void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } +#if EITHER(PIDTEMP, PIDTEMPBED) + void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } + void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } +#endif void onDrawSpeedItem(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) menuitem->SetFrame(1, 116, 164, 171, 176); @@ -2907,16 +2772,6 @@ void onDrawSteps(MenuItemClass* menuitem, int8_t line) { onDrawPIntMenu(menuitem, line); } #endif - void onDrawPLAPreheatSubMenu(MenuItemClass* menuitem, int8_t line) { - if (HMI_IsChinese()) menuitem->SetFrame(1, 100, 89, 178, 101); - onDrawSubMenu(menuitem,line); - } - #if PREHEAT_COUNT >= 2 - void onDrawABSPreheatSubMenu(MenuItemClass* menuitem, int8_t line) { - if (HMI_IsChinese()) menuitem->SetFrame(1, 180, 89, 260, 100); - onDrawSubMenu(menuitem,line); - } - #endif #endif // HAS_PREHEAT void onDrawSpeed(MenuItemClass* menuitem, int8_t line) { @@ -3100,161 +2955,145 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { // Menu Creation and Drawing functions ====================================================== -void SetMenuTitle(frame_rect_t cn, const __FlashStringHelper* fstr) { - if (HMI_IsChinese() && (cn.w != 0)) - CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h); +frame_rect_t selrect(frame_rect_t) { + if (HMI_IsChinese()) + return {133, 1, 28, 13}; else - CurrentMenu->MenuTitle.SetCaption(fstr); + return{0}; } void Draw_Prepare_Menu() { checkkey = Menu; - if (!PrepareMenu) PrepareMenu = new MenuClass(); - if (CurrentMenu != PrepareMenu) { - CurrentMenu = PrepareMenu; - SetMenuTitle({133, 1, 28, 13}, GET_TEXT_F(MSG_PREPARE)); - MenuItemsPrepare(13); + if (SET_MENU_R(PrepareMenu, selrect({133, 1, 28, 13}), MSG_PREPARE, 10 + PREHEAT_COUNT)) { BACK_ITEM(Goto_Main_Menu); #if ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM_F(ICON_FilMan, MSG_FILAMENT_MAN, onDrawSubMenu, Draw_FilamentMan_Menu); + MENU_ITEM(ICON_FilMan, MSG_FILAMENT_MAN, onDrawSubMenu, Draw_FilamentMan_Menu); #endif - MENU_ITEM_F(ICON_Axis, MSG_MOVE_AXIS, onDrawMoveSubMenu, Goto_Move_Menu); - MENU_ITEM_F(ICON_Tram, MSG_BED_TRAMMING, onDrawSubMenu, Draw_Tramming_Menu); - MENU_ITEM_F(ICON_CloseMotor, MSG_DISABLE_STEPPERS, onDrawDisableMotors, DisableMotors); + MENU_ITEM(ICON_Axis, MSG_MOVE_AXIS, onDrawMoveSubMenu, Draw_Move_Menu); + MENU_ITEM(ICON_Tram, MSG_BED_TRAMMING, onDrawSubMenu, Draw_Tramming_Menu); + MENU_ITEM(ICON_CloseMotor, MSG_DISABLE_STEPPERS, onDrawDisableMotors, DisableMotors); #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) - MENU_ITEM_F(ICON_Homing, MSG_HOMING, onDrawSubMenu, Draw_Homing_Menu); + MENU_ITEM(ICON_Homing, MSG_HOMING, onDrawSubMenu, Draw_Homing_Menu); #else - MENU_ITEM_F(ICON_Homing, MSG_AUTO_HOME, onDrawAutoHome, AutoHome); + MENU_ITEM(ICON_Homing, MSG_AUTO_HOME, onDrawAutoHome, AutoHome); #endif #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM_F(ICON_ManualMesh, MSG_MANUAL_MESH, onDrawSubMenu, Draw_ManualMesh_Menu); - #endif - #if HAS_ONESTEP_LEVELING - MENU_ITEM_F(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); + MENU_ITEM(ICON_ManualMesh, MSG_MANUAL_MESH, onDrawSubMenu, Draw_ManualMesh_Menu); + #elif HAS_BED_PROBE + MENU_ITEM(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); #endif #if HAS_ZOFFSET_ITEM - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM_F(ICON_SetZOffset, MSG_PROBE_WIZARD, onDrawSubMenu, Draw_ZOffsetWiz_Menu); - #elif JUST_BABYSTEP - EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); - #else - MENU_ITEM_F(ICON_SetHome, MSG_SET_HOME_OFFSETS, onDrawHomeOffset, SetHome); + #if HAS_BED_PROBE + MENU_ITEM(ICON_SetZOffset, MSG_PROBE_WIZARD, onDrawSubMenu, Draw_ZOffsetWiz_Menu); + #elif ENABLED(BABYSTEPPING) + EDIT_ITEM(ICON_Zoffset, MSG_HOME_OFFSET_Z, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); + #elif HAS_HOME_OFFSET + MENU_ITEM(ICON_SetHome, MSG_SET_HOME_OFFSETS, onDrawHomeOffset, SetHome); #endif #endif #if HAS_PREHEAT - MENU_ITEM_F(ICON_PLAPreheat, MSG_PREHEAT_1, onDrawPreheat1, DoPreheat0); - #if PREHEAT_COUNT > 1 - MENU_ITEM(ICON_ABSPreheat, F("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, DoPreheat1); - #if PREHEAT_COUNT > 2 - MENU_ITEM(ICON_CustomPreheat, F("Preheat " PREHEAT_3_LABEL), onDrawMenuItem, DoPreheat2); - #endif - #endif + #define _ITEM_PREHEAT(N) MENU_ITEM(ICON_Preheat##N, MSG_PREHEAT_##N, onDrawMenuItem, DoPreheat##N); + REPEAT_1(PREHEAT_COUNT, _ITEM_PREHEAT) #endif - MENU_ITEM_F(ICON_Cool, MSG_COOLDOWN, onDrawCooldown, DoCoolDown); - MENU_ITEM_F(ICON_Language, MSG_UI_LANGUAGE, onDrawLanguage, SetLanguage); + MENU_ITEM(ICON_Cool, MSG_COOLDOWN, onDrawCooldown, DoCoolDown); + MENU_ITEM(ICON_Language, MSG_UI_LANGUAGE, onDrawLanguage, SetLanguage); } ui.reset_status(true); - CurrentMenu->draw(); + UpdateMenu(PrepareMenu); } void Draw_Tramming_Menu() { checkkey = Menu; - if (SetMenu(TrammingMenu, GET_TEXT_F(MSG_BED_TRAMMING), 8)) { + if (SET_MENU(TrammingMenu, MSG_BED_TRAMMING, 8)) { BACK_ITEM(Draw_Prepare_Menu); - #if HAS_BED_PROBE - MENU_ITEM_F(ICON_ProbeSet, MSG_TRAMMING_WIZARD, onDrawMenuItem, Trammingwizard); - EDIT_ITEM_F(ICON_ProbeSet, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, SetManualTramming, &HMI_data.FullManualTramming); - #else - MENU_ITEM(ICON_MoveZ0, F("Home Z and disable"), onDrawMenuItem, HomeZandDisable); - #endif - MENU_ITEM_F(ICON_Axis, MSG_LEVBED_FL, onDrawMenuItem, TramFL); - MENU_ITEM_F(ICON_Axis, MSG_LEVBED_FR, onDrawMenuItem, TramFR); - MENU_ITEM_F(ICON_Axis, MSG_LEVBED_BR, onDrawMenuItem, TramBR); - MENU_ITEM_F(ICON_Axis, MSG_LEVBED_BL, onDrawMenuItem, TramBL); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC ); + #if HAS_BED_PROBE && HAS_MESH + MENU_ITEM(ICON_ProbeSet, MSG_TRAMMING_WIZARD, onDrawMenuItem, Trammingwizard); + EDIT_ITEM(ICON_ProbeSet, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, SetManualTramming, &HMI_data.FullManualTramming); + #elif !HAS_BED_PROBE && HAS_ZOFFSET_ITEM + MENU_ITEM_F(ICON_MoveZ0, "Home Z and disable", onDrawMenuItem, HomeZandDisable); + #endif + MENU_ITEM(ICON_Axis, MSG_LEVBED_FL, onDrawMenuItem, TramFL); + MENU_ITEM(ICON_Axis, MSG_LEVBED_FR, onDrawMenuItem, TramFR); + MENU_ITEM(ICON_Axis, MSG_LEVBED_BR, onDrawMenuItem, TramBR); + MENU_ITEM(ICON_Axis, MSG_LEVBED_BL, onDrawMenuItem, TramBL); + MENU_ITEM(ICON_Axis, MSG_LEVBED_C, onDrawMenuItem, TramC ); } UpdateMenu(TrammingMenu); } void Draw_Control_Menu() { checkkey = Menu; - if (!ControlMenu) ControlMenu = new MenuClass(); - if (CurrentMenu != ControlMenu) { - CurrentMenu = ControlMenu; - SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); - MenuItemsPrepare(10); + if (SET_MENU_R(ControlMenu, selrect({103, 1, 28, 14}), MSG_CONTROL, 10)) { BACK_ITEM(Goto_Main_Menu); - MENU_ITEM_F(ICON_Temperature, MSG_TEMPERATURE, onDrawTempSubMenu, Draw_Temperature_Menu); - MENU_ITEM_F(ICON_Motion, MSG_MOTION, onDrawMotionSubMenu, Draw_Motion_Menu); + MENU_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawTempSubMenu, Draw_Temperature_Menu); + MENU_ITEM(ICON_Motion, MSG_MOTION, onDrawMotionSubMenu, Draw_Motion_Menu); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, WriteEeprom); - MENU_ITEM_F(ICON_ReadEEPROM, MSG_LOAD_EEPROM, onDrawReadEeprom, ReadEeprom); - MENU_ITEM_F(ICON_ResumeEEPROM, MSG_RESTORE_DEFAULTS, onDrawResetEeprom, ResetEeprom); + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, WriteEeprom); + MENU_ITEM(ICON_ReadEEPROM, MSG_LOAD_EEPROM, onDrawReadEeprom, ReadEeprom); + MENU_ITEM(ICON_ResumeEEPROM, MSG_RESTORE_DEFAULTS, onDrawResetEeprom, ResetEeprom); #endif - MENU_ITEM_F(ICON_Reboot, MSG_RESET_PRINTER, onDrawMenuItem, RebootPrinter); + MENU_ITEM(ICON_Reboot, MSG_RESET_PRINTER, onDrawMenuItem, RebootPrinter); #if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASELIGHT_USES_BRIGHTNESS) - MENU_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, Draw_CaseLight_Menu); + MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, Draw_CaseLight_Menu); #else - MENU_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); + MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); #endif #endif #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM_F(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, Draw_LedControl_Menu); + MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, Draw_LedControl_Menu); #endif - MENU_ITEM_F(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, Goto_Info_Menu); + MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, Goto_Info_Menu); } ui.reset_status(true); - CurrentMenu->draw(); + UpdateMenu(ControlMenu); } void Draw_AdvancedSettings_Menu() { checkkey = Menu; - if (SetMenu(AdvancedSettings, GET_TEXT_F(MSG_ADVANCED_SETTINGS), 20)) { + if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 18)) { BACK_ITEM(Goto_Main_Menu); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); - #endif - #if HAS_BED_PROBE - MENU_ITEM_F(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, Draw_ProbeSet_Menu); + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); #endif #if HAS_MESH - MENU_ITEM_F(ICON_ProbeSet, MSG_MESH_LEVELING, onDrawSubMenu, Draw_MeshSet_Menu); + MENU_ITEM(ICON_ProbeSet, MSG_MESH_LEVELING, onDrawSubMenu, Draw_MeshSet_Menu); #endif - #if HAS_HOME_OFFSET - MENU_ITEM_F(ICON_HomeOffset, MSG_SET_HOME_OFFSETS, onDrawSubMenu, Draw_HomeOffset_Menu); + #if HAS_BED_PROBE + MENU_ITEM(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, Draw_ProbeSet_Menu); #endif + MENU_ITEM(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, Draw_FilSet_Menu); #if ENABLED(PIDTEMP) - MENU_ITEM(ICON_PIDNozzle, F(STR_HOTEND_PID " Settings"), onDrawSubMenu, Draw_HotendPID_Menu); + MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID " Settings", onDrawSubMenu, Draw_HotendPID_Menu); #endif #if ENABLED(PIDTEMPBED) - MENU_ITEM(ICON_PIDbed, F(STR_BED_PID " Settings"), onDrawSubMenu, Draw_BedPID_Menu); + MENU_ITEM_F(ICON_PIDBed, STR_BED_PID " Settings", onDrawSubMenu, Draw_BedPID_Menu); #endif - MENU_ITEM_F(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, Draw_FilSet_Menu); - #if ENABLED(POWER_LOSS_RECOVERY) - EDIT_ITEM_F(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, SetPwrLossr, &recovery.enabled); + #if HAS_ESDIAG + MENU_ITEM_F(ICON_ESDiag, "End-stops diag.", onDrawSubMenu, Draw_EndStopDiag); #endif - #if ENABLED(BAUD_RATE_GCODE) - EDIT_ITEM(ICON_SetBaudRate, F("115K baud"), onDrawChkbMenu, SetBaudRate, &HMI_data.Baud115K); + #if ENABLED(PRINTCOUNTER) + MENU_ITEM(ICON_PrintStats, MSG_INFO_STATS_MENU, onDrawSubMenu, Goto_PrintStats); + MENU_ITEM(ICON_PrintStatsReset, MSG_INFO_PRINT_COUNT_RESET, onDrawSubMenu, PrintStatsReset); #endif - #if HAS_LCD_BRIGHTNESS - EDIT_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); - MENU_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); + #if HAS_LOCKSCREEN + MENU_ITEM(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); #endif - MENU_ITEM_F(ICON_Scolor, MSG_COLORS_SELECT, onDrawSubMenu, Draw_SelectColors_Menu); #if ENABLED(SOUND_MENU_ITEM) - EDIT_ITEM_F(ICON_Sound, MSG_SOUND_ENABLE, onDrawChkbMenu, SetEnableSound, &ui.sound_on); + EDIT_ITEM(ICON_Sound, MSG_SOUND_ENABLE, onDrawChkbMenu, SetEnableSound, &ui.sound_on); #endif - #if HAS_ESDIAG - MENU_ITEM(ICON_ESDiag, F("End-stops diag."), onDrawSubMenu, Draw_EndStopDiag); + #if ENABLED(POWER_LOSS_RECOVERY) + EDIT_ITEM(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, SetPwrLossr, &recovery.enabled); #endif - #if ENABLED(PRINTCOUNTER) - MENU_ITEM_F(ICON_PrintStats, MSG_INFO_STATS_MENU, onDrawSubMenu, Goto_PrintStats); - MENU_ITEM_F(ICON_PrintStatsReset, MSG_INFO_PRINT_COUNT_RESET, onDrawSubMenu, PrintStats.Reset); + EDIT_ITEM(ICON_File, MSG_MEDIA_UPDATE, onDrawChkbMenu, SetMediaAutoMount, &HMI_data.MediaAutoMount); + #if ENABLED(BAUD_RATE_GCODE) + EDIT_ITEM_F(ICON_SetBaudRate, "115K baud", onDrawChkbMenu, SetBaudRate, &HMI_data.Baud115K); #endif - #if HAS_LOCKSCREEN - MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); + #if HAS_LCD_BRIGHTNESS + EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); + MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); #endif + MENU_ITEM(ICON_Scolor, MSG_COLORS_SELECT, onDrawSubMenu, Draw_SelectColors_Menu); } ui.reset_status(true); UpdateMenu(AdvancedSettings); @@ -3262,31 +3101,29 @@ void Draw_AdvancedSettings_Menu() { void Draw_Move_Menu() { checkkey = Menu; - if (!MoveMenu) MoveMenu = new MenuClass(); - if (CurrentMenu != MoveMenu) { - CurrentMenu = MoveMenu; - SetMenuTitle({192, 1, 42, 14}, GET_TEXT_F(MSG_MOVE_AXIS)); - MenuItemsPrepare(5); + if (SET_MENU_R(MoveMenu, selrect({192, 1, 42, 14}), MSG_MOVE_AXIS, 6)) { BACK_ITEM(Draw_Prepare_Menu); - EDIT_ITEM_F(ICON_MoveX, MSG_MOVE_X, onDrawMoveX, SetMoveX, ¤t_position.x); - EDIT_ITEM_F(ICON_MoveY, MSG_MOVE_Y, onDrawMoveY, SetMoveY, ¤t_position.y); - EDIT_ITEM_F(ICON_MoveZ, MSG_MOVE_Z, onDrawMoveZ, SetMoveZ, ¤t_position.z); + EDIT_ITEM(ICON_Axis, MSG_LIVE_MOVE, onDrawChkbMenu, SetLiveMove, &EnableLiveMove); + EDIT_ITEM(ICON_MoveX, MSG_MOVE_X, onDrawMoveX, SetMoveX, ¤t_position.x); + EDIT_ITEM(ICON_MoveY, MSG_MOVE_Y, onDrawMoveY, SetMoveY, ¤t_position.y); + EDIT_ITEM(ICON_MoveZ, MSG_MOVE_Z, onDrawMoveZ, SetMoveZ, ¤t_position.z); #if HAS_HOTEND - EDIT_ITEM_F(ICON_Extruder, MSG_MOVE_E, onDrawMoveE, SetMoveE, ¤t_position.e); + gcode.process_subcommands_now(F("G92E0")); // reset extruder position + EDIT_ITEM(ICON_Extruder, MSG_MOVE_E, onDrawMoveE, SetMoveE, ¤t_position.e); #endif } - CurrentMenu->draw(); + UpdateMenu(MoveMenu); if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: Current position unknown. Home axes."); } #if HAS_HOME_OFFSET void Draw_HomeOffset_Menu() { checkkey = Menu; - if (SetMenu(HomeOffMenu, GET_TEXT_F(MSG_SET_HOME_OFFSETS), 4)) { - BACK_ITEM(Draw_AdvancedSettings_Menu); - EDIT_ITEM_F(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, SetHomeOffsetX, &home_offset.x); - EDIT_ITEM_F(ICON_HomeOffsetY, MSG_HOME_OFFSET_Y, onDrawPFloatMenu, SetHomeOffsetY, &home_offset.y); - EDIT_ITEM_F(ICON_HomeOffsetZ, MSG_HOME_OFFSET_Z, onDrawPFloatMenu, SetHomeOffsetZ, &home_offset.z); + if (SET_MENU(HomeOffMenu, MSG_SET_HOME_OFFSETS, 4)) { + BACK_ITEM(Draw_PhySet_Menu); + EDIT_ITEM(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, SetHomeOffsetX, &home_offset.x); + EDIT_ITEM(ICON_HomeOffsetY, MSG_HOME_OFFSET_Y, onDrawPFloatMenu, SetHomeOffsetY, &home_offset.y); + EDIT_ITEM(ICON_HomeOffsetZ, MSG_HOME_OFFSET_Z, onDrawPFloatMenu, SetHomeOffsetZ, &home_offset.z); } UpdateMenu(HomeOffMenu); } @@ -3295,45 +3132,44 @@ void Draw_Move_Menu() { #if HAS_BED_PROBE void Draw_ProbeSet_Menu() { checkkey = Menu; - if (SetMenu(ProbeSetMenu, GET_TEXT_F(MSG_ZPROBE_SETTINGS), 8)) { + if (SET_MENU(ProbeSetMenu, MSG_ZPROBE_SETTINGS, 9)) { BACK_ITEM(Draw_AdvancedSettings_Menu); - EDIT_ITEM_F(ICON_ProbeOffsetX, MSG_ZPROBE_XOFFSET, onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); - EDIT_ITEM_F(ICON_ProbeOffsetY, MSG_ZPROBE_YOFFSET, onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); - EDIT_ITEM_F(ICON_ProbeOffsetZ, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); + EDIT_ITEM(ICON_ProbeOffsetX, MSG_ZPROBE_XOFFSET, onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); + EDIT_ITEM(ICON_ProbeOffsetY, MSG_ZPROBE_YOFFSET, onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); + EDIT_ITEM(ICON_ProbeOffsetZ, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); #if ENABLED(BLTOUCH) - MENU_ITEM_F(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow); - MENU_ITEM_F(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy); - MENU_ITEM_F(ICON_BltouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); - #ifdef BLTOUCH_HS_MODE - EDIT_ITEM_F(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode); + MENU_ITEM(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow); + MENU_ITEM(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy); + MENU_ITEM(ICON_BltouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); + #if ENABLED(BLTOUCH_HS_MODE) + EDIT_ITEM(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode); #endif #endif - MENU_ITEM_F(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, ProbeTest); + MENU_ITEM(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, ProbeTest); } UpdateMenu(ProbeSetMenu); } - #endif void Draw_FilSet_Menu() { checkkey = Menu; - if (SetMenu(FilSetMenu, GET_TEXT_F(MSG_FILAMENT_SET), 9)) { + if (SET_MENU(FilSetMenu, MSG_FILAMENT_SET, 9)) { BACK_ITEM(Draw_AdvancedSettings_Menu); #if HAS_FILAMENT_SENSOR - EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled); + EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled); #endif #if HAS_FILAMENT_RUNOUT_DISTANCE - EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance()); + EDIT_ITEM(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance()); #endif #if ENABLED(PREVENT_COLD_EXTRUSION) - EDIT_ITEM_F(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); + EDIT_ITEM(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - EDIT_ITEM_F(ICON_FilLoad, MSG_FILAMENT_LOAD, onDrawPFloatMenu, SetFilLoad, &fc_settings[0].load_length); - EDIT_ITEM_F(ICON_FilUnload, MSG_FILAMENT_UNLOAD, onDrawPFloatMenu, SetFilUnload, &fc_settings[0].unload_length); + EDIT_ITEM(ICON_FilLoad, MSG_FILAMENT_LOAD, onDrawPFloatMenu, SetFilLoad, &fc_settings[0].load_length); + EDIT_ITEM(ICON_FilUnload, MSG_FILAMENT_UNLOAD, onDrawPFloatMenu, SetFilUnload, &fc_settings[0].unload_length); #endif #if ENABLED(FWRETRACT) - MENU_ITEM_F(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); + MENU_ITEM(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); #endif } UpdateMenu(FilSetMenu); @@ -3341,80 +3177,80 @@ void Draw_FilSet_Menu() { void Draw_SelectColors_Menu() { checkkey = Menu; - if (SetMenu(SelectColorMenu, GET_TEXT_F(MSG_COLORS_SELECT), 20)) { + if (SET_MENU(SelectColorMenu, MSG_COLORS_SELECT, 20)) { BACK_ITEM(Draw_AdvancedSettings_Menu); - MENU_ITEM_F(ICON_StockConfiguration, MSG_RESTORE_DEFAULTS, onDrawMenuItem, RestoreDefaultsColors); - EDIT_ITEM(0, F("Screen Background"), onDrawSelColorItem, SelColor, &HMI_data.Background_Color); - EDIT_ITEM(0, F("Cursor"), onDrawSelColorItem, SelColor, &HMI_data.Cursor_color); - EDIT_ITEM(0, F("Title Background"), onDrawSelColorItem, SelColor, &HMI_data.TitleBg_color); - EDIT_ITEM(0, F("Title Text"), onDrawSelColorItem, SelColor, &HMI_data.TitleTxt_color); - EDIT_ITEM(0, F("Text"), onDrawSelColorItem, SelColor, &HMI_data.Text_Color); - EDIT_ITEM(0, F("Selected"), onDrawSelColorItem, SelColor, &HMI_data.Selected_Color); - EDIT_ITEM(0, F("Split Line"), onDrawSelColorItem, SelColor, &HMI_data.SplitLine_Color); - EDIT_ITEM(0, F("Highlight"), onDrawSelColorItem, SelColor, &HMI_data.Highlight_Color); - EDIT_ITEM(0, F("Status Background"), onDrawSelColorItem, SelColor, &HMI_data.StatusBg_Color); - EDIT_ITEM(0, F("Status Text"), onDrawSelColorItem, SelColor, &HMI_data.StatusTxt_Color); - EDIT_ITEM(0, F("Popup Background"), onDrawSelColorItem, SelColor, &HMI_data.PopupBg_color); - EDIT_ITEM(0, F("Popup Text"), onDrawSelColorItem, SelColor, &HMI_data.PopupTxt_Color); - EDIT_ITEM(0, F("Alert Background"), onDrawSelColorItem, SelColor, &HMI_data.AlertBg_Color); - EDIT_ITEM(0, F("Alert Text"), onDrawSelColorItem, SelColor, &HMI_data.AlertTxt_Color); - EDIT_ITEM(0, F("Percent Text"), onDrawSelColorItem, SelColor, &HMI_data.PercentTxt_Color); - EDIT_ITEM(0, F("Bar Fill"), onDrawSelColorItem, SelColor, &HMI_data.Barfill_Color); - EDIT_ITEM(0, F("Indicator value"), onDrawSelColorItem, SelColor, &HMI_data.Indicator_Color); - EDIT_ITEM(0, F("Coordinate value"), onDrawSelColorItem, SelColor, &HMI_data.Coordinate_Color); + MENU_ITEM(ICON_StockConfiguration, MSG_RESTORE_DEFAULTS, onDrawMenuItem, RestoreDefaultColors); + EDIT_ITEM_F(0, "Screen Background", onDrawSelColorItem, SelColor, &HMI_data.Background_Color); + EDIT_ITEM_F(0, "Cursor", onDrawSelColorItem, SelColor, &HMI_data.Cursor_Color); + EDIT_ITEM_F(0, "Title Background", onDrawSelColorItem, SelColor, &HMI_data.TitleBg_Color); + EDIT_ITEM_F(0, "Title Text", onDrawSelColorItem, SelColor, &HMI_data.TitleTxt_Color); + EDIT_ITEM_F(0, "Text", onDrawSelColorItem, SelColor, &HMI_data.Text_Color); + EDIT_ITEM_F(0, "Selected", onDrawSelColorItem, SelColor, &HMI_data.Selected_Color); + EDIT_ITEM_F(0, "Split Line", onDrawSelColorItem, SelColor, &HMI_data.SplitLine_Color); + EDIT_ITEM_F(0, "Highlight", onDrawSelColorItem, SelColor, &HMI_data.Highlight_Color); + EDIT_ITEM_F(0, "Status Background", onDrawSelColorItem, SelColor, &HMI_data.StatusBg_Color); + EDIT_ITEM_F(0, "Status Text", onDrawSelColorItem, SelColor, &HMI_data.StatusTxt_Color); + EDIT_ITEM_F(0, "Popup Background", onDrawSelColorItem, SelColor, &HMI_data.PopupBg_Color); + EDIT_ITEM_F(0, "Popup Text", onDrawSelColorItem, SelColor, &HMI_data.PopupTxt_Color); + EDIT_ITEM_F(0, "Alert Background", onDrawSelColorItem, SelColor, &HMI_data.AlertBg_Color); + EDIT_ITEM_F(0, "Alert Text", onDrawSelColorItem, SelColor, &HMI_data.AlertTxt_Color); + EDIT_ITEM_F(0, "Percent Text", onDrawSelColorItem, SelColor, &HMI_data.PercentTxt_Color); + EDIT_ITEM_F(0, "Bar Fill", onDrawSelColorItem, SelColor, &HMI_data.Barfill_Color); + EDIT_ITEM_F(0, "Indicator value", onDrawSelColorItem, SelColor, &HMI_data.Indicator_Color); + EDIT_ITEM_F(0, "Coordinate value", onDrawSelColorItem, SelColor, &HMI_data.Coordinate_Color); } UpdateMenu(SelectColorMenu); } void Draw_GetColor_Menu() { checkkey = Menu; - if (SetMenu(GetColorMenu, GET_TEXT_F(MSG_COLORS_GET), 5)) { + if (SET_MENU(GetColorMenu, MSG_COLORS_GET, 5)) { BACK_ITEM(DWIN_ApplyColor); - MENU_ITEM_F(ICON_Cancel, MSG_BUTTON_CANCEL, onDrawMenuItem, Draw_SelectColors_Menu); - MENU_ITEM_F(0, MSG_COLORS_RED, onDrawGetColorItem, SetRGBColor); - MENU_ITEM_F(1, MSG_COLORS_GREEN, onDrawGetColorItem, SetRGBColor); - MENU_ITEM_F(2, MSG_COLORS_BLUE, onDrawGetColorItem, SetRGBColor); + MENU_ITEM(ICON_Cancel, MSG_BUTTON_CANCEL, onDrawMenuItem, Draw_SelectColors_Menu); + MENU_ITEM(0, MSG_COLORS_RED, onDrawGetColorItem, SetRGBColor); + MENU_ITEM(1, MSG_COLORS_GREEN, onDrawGetColorItem, SetRGBColor); + MENU_ITEM(2, MSG_COLORS_BLUE, onDrawGetColorItem, SetRGBColor); } UpdateMenu(GetColorMenu); DWIN_Draw_Rectangle(1, *MenuData.P_Int, 20, 315, DWIN_WIDTH - 20, 335); } #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) - void Draw_CaseLight_Menu() { - checkkey = Menu; - if (SetMenu(CaseLightMenu, GET_TEXT_F(MSG_CASE_LIGHT), 3)) { - BACK_ITEM(Draw_Control_Menu); - EDIT_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); - EDIT_ITEM_F(ICON_Brightness, MSG_CASE_LIGHT_BRIGHTNESS, onDrawPInt8Menu, SetCaseLightBrightness, &caselight.brightness); - } - UpdateMenu(CaseLightMenu); + void Draw_CaseLight_Menu() { + checkkey = Menu; + if (SET_MENU(CaseLightMenu, MSG_CASE_LIGHT, 3)) { + BACK_ITEM(Draw_Control_Menu); + EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); + EDIT_ITEM(ICON_Brightness, MSG_CASE_LIGHT_BRIGHTNESS, onDrawPInt8Menu, SetCaseLightBrightness, &caselight.brightness); } + UpdateMenu(CaseLightMenu); + } #endif #if ENABLED(LED_CONTROL_MENU) void Draw_LedControl_Menu() { checkkey = Menu; - if (SetMenu(LedControlMenu, GET_TEXT_F(MSG_LED_CONTROL), 6)) { + if (SET_MENU(LedControlMenu, MSG_LED_CONTROL, 10)) { BACK_ITEM(Draw_Control_Menu); #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) - EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); + EDIT_ITEM(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); #endif #if HAS_COLOR_LEDS #if ENABLED(LED_COLOR_PRESETS) - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_WHITE, onDrawMenuItem, leds.set_white); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_RED, onDrawMenuItem, leds.set_red); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_ORANGE, onDrawMenuItem, leds.set_orange); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_YELLOW, onDrawMenuItem, leds.set_yellow); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_GREEN, onDrawMenuItem, leds.set_green); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_BLUE, onDrawMenuItem, leds.set_blue); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_INDIGO, onDrawMenuItem, leds.set_indigo); - MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_VIOLET, onDrawMenuItem, leds.set_violet); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_WHITE, onDrawMenuItem, leds.set_white); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_RED, onDrawMenuItem, leds.set_red); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_ORANGE, onDrawMenuItem, leds.set_orange); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_YELLOW, onDrawMenuItem, leds.set_yellow); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_GREEN, onDrawMenuItem, leds.set_green); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_BLUE, onDrawMenuItem, leds.set_blue); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_INDIGO, onDrawMenuItem, leds.set_indigo); + MENU_ITEM(ICON_LedControl, MSG_SET_LEDS_VIOLET, onDrawMenuItem, leds.set_violet); #else - EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_RED, onDrawPInt8Menu, SetLEDColorR, &leds.color.r); - EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g); - EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b); + EDIT_ITEM(ICON_LedControl, MSG_COLORS_RED, onDrawPInt8Menu, SetLEDColorR, &leds.color.r); + EDIT_ITEM(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g); + EDIT_ITEM(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b); #if ENABLED(HAS_WHITE_LED) - EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLEDColorW, &leds.color.w); + EDIT_ITEM(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLEDColorW, &leds.color.w); #endif #endif #endif @@ -3425,77 +3261,76 @@ void Draw_GetColor_Menu() { void Draw_Tune_Menu() { checkkey = Menu; - if (!TuneMenu) TuneMenu = new MenuClass(); - if (CurrentMenu != TuneMenu) { - CurrentMenu = TuneMenu; - SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG - MenuItemsPrepare(16); + if (SET_MENU_R(TuneMenu, selrect({73, 2, 28, 12}), MSG_TUNE, 14)) { BACK_ITEM(Goto_PrintProcess); - EDIT_ITEM_F(ICON_Speed, MSG_SPEED, onDrawSpeedItem, SetSpeed, &feedrate_percentage); + EDIT_ITEM(ICON_Speed, MSG_SPEED, onDrawSpeedItem, SetSpeed, &feedrate_percentage); #if HAS_HOTEND - HotendTargetItem = EDIT_ITEM_F(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); + HotendTargetItem = EDIT_ITEM(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - BedTargetItem = EDIT_ITEM_F(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); + BedTargetItem = EDIT_ITEM(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN - FanSpeedItem = EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); + FanSpeedItem = EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); #endif - #if HAS_ZOFFSET_ITEM && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawZOffset, SetZOffset, &BABY_Z_VAR); + #if ALL(HAS_ZOFFSET_ITEM, HAS_BED_PROBE, BABYSTEPPING) + EDIT_ITEM(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawZOffset, SetZOffset, &BABY_Z_VAR); + #elif ALL(HAS_ZOFFSET_ITEM, MESH_BED_LEVELING, BABYSTEPPING) + EDIT_ITEM(ICON_Zoffset, MSG_HOME_OFFSET_Z, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); #endif - EDIT_ITEM_F(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); + EDIT_ITEM(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); #if ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM_F(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, ChangeFilament); + MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, ChangeFilament); + #endif + #if HAS_FILAMENT_SENSOR + EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled); #endif #if ENABLED(FWRETRACT) - MENU_ITEM_F(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); + MENU_ITEM(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); #endif #if HAS_LOCKSCREEN - MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); + MENU_ITEM(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); #endif #if HAS_LCD_BRIGHTNESS - EDIT_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); - MENU_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); + EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); + MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); #endif #if ENABLED(CASE_LIGHT_MENU) - EDIT_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); + EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) - EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); + EDIT_ITEM(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); #endif } - CurrentMenu->draw(); + UpdateMenu(TuneMenu); } void Draw_Motion_Menu() { checkkey = Menu; - if (!MotionMenu) MotionMenu = new MenuClass(); - if (CurrentMenu != MotionMenu) { - CurrentMenu = MotionMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG - MenuItemsPrepare(6); + if (SET_MENU_R(MotionMenu, selrect({1, 16, 28, 13}), MSG_MOTION, 6)) { BACK_ITEM(Draw_Control_Menu); - MENU_ITEM_F(ICON_MaxSpeed, MSG_SPEED, onDrawSpeed, Draw_MaxSpeed_Menu); - MENU_ITEM_F(ICON_MaxAccelerated, MSG_ACCELERATION, onDrawAcc, Draw_MaxAccel_Menu); + MENU_ITEM(ICON_MaxSpeed, MSG_SPEED, onDrawSpeed, Draw_MaxSpeed_Menu); + MENU_ITEM(ICON_MaxAccelerated, MSG_ACCELERATION, onDrawAcc, Draw_MaxAccel_Menu); #if HAS_CLASSIC_JERK - MENU_ITEM_F(ICON_MaxJerk, MSG_JERK, onDrawJerk, Draw_MaxJerk_Menu); + MENU_ITEM(ICON_MaxJerk, MSG_JERK, onDrawJerk, Draw_MaxJerk_Menu); #endif - MENU_ITEM_F(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, Draw_Steps_Menu); - EDIT_ITEM_F(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); + MENU_ITEM(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, Draw_Steps_Menu); + EDIT_ITEM(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); } - CurrentMenu->draw(); + UpdateMenu(MotionMenu); } #if ENABLED(ADVANCED_PAUSE_FEATURE) void Draw_FilamentMan_Menu() { checkkey = Menu; - if (SetMenu(FilamentMenu, GET_TEXT_F(MSG_FILAMENT_MAN), 5)) { + if (SET_MENU(FilamentMenu, MSG_FILAMENT_MAN, 5)) { BACK_ITEM(Draw_Prepare_Menu); - MENU_ITEM_F(ICON_Park, MSG_FILAMENT_PARK_ENABLED, onDrawMenuItem, ParkHead); - MENU_ITEM_F(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, ChangeFilament); + #if ENABLED(NOZZLE_PARK_FEATURE) + MENU_ITEM(ICON_Park, MSG_FILAMENT_PARK_ENABLED, onDrawMenuItem, ParkHead); + #endif + MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, ChangeFilament); #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - MENU_ITEM_F(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, UnloadFilament); - MENU_ITEM_F(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, LoadFilament); + MENU_ITEM(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, UnloadFilament); + MENU_ITEM(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, LoadFilament); #endif } UpdateMenu(FilamentMenu); @@ -3505,13 +3340,13 @@ void Draw_Motion_Menu() { #if ENABLED(MESH_BED_LEVELING) void Draw_ManualMesh_Menu() { checkkey = Menu; - if (SetMenu(ManualMesh, GET_TEXT_F(MSG_UBL_MANUAL_MESH), 6)) { + if (SET_MENU(ManualMesh, MSG_UBL_MANUAL_MESH, 6)) { BACK_ITEM(Draw_Prepare_Menu); - MENU_ITEM_F(ICON_ManualMesh, MSG_LEVEL_BED, onDrawMenuItem, ManualMeshStart); - MMeshMoveZItem = EDIT_ITEM_F(ICON_Zoffset, MSG_MOVE_Z, onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); - MENU_ITEM_F(ICON_Axis, MSG_UBL_CONTINUE_MESH, onDrawMenuItem, ManualMeshContinue); - MENU_ITEM_F(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer); - MENU_ITEM_F(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, ManualMeshSave); + MENU_ITEM(ICON_ManualMesh, MSG_LEVEL_BED, onDrawMenuItem, ManualMeshStart); + MMeshMoveZItem = EDIT_ITEM(ICON_Zoffset, MSG_MOVE_Z, onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); + MENU_ITEM(ICON_Axis, MSG_UBL_CONTINUE_MESH, onDrawMenuItem, ManualMeshContinue); + MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer); + MENU_ITEM(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, ManualMeshSave); } UpdateMenu(ManualMesh); } @@ -3519,170 +3354,127 @@ void Draw_Motion_Menu() { #if HAS_PREHEAT - void Draw_Preheat_Menu(frame_rect_t cn, const __FlashStringHelper* fstr) { + void Draw_Preheat_Menu(bool NotCurrent) { checkkey = Menu; - if (CurrentMenu != PreheatMenu) { - CurrentMenu = PreheatMenu; - SetMenuTitle(cn, fstr); - MenuItemsPrepare(5); + if (NotCurrent) { BACK_ITEM(Draw_Temperature_Menu); #if HAS_HOTEND - EDIT_ITEM_F(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, SetPreheatEndTemp, &ui.material_preset[HMI_value.Select].hotend_temp); + EDIT_ITEM(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, SetPreheatEndTemp, &ui.material_preset[HMI_value.Select].hotend_temp); #endif #if HAS_HEATED_BED - EDIT_ITEM_F(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, SetPreheatBedTemp, &ui.material_preset[HMI_value.Select].bed_temp); + EDIT_ITEM(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, SetPreheatBedTemp, &ui.material_preset[HMI_value.Select].bed_temp); #endif #if HAS_FAN - EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawSetPreheatFan, SetPreheatFanSpeed, &ui.material_preset[HMI_value.Select].fan_speed); + EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawSetPreheatFan, SetPreheatFanSpeed, &ui.material_preset[HMI_value.Select].fan_speed); #endif #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, WriteEeprom); + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, WriteEeprom); #endif } - CurrentMenu->draw(); - } - - void Draw_Preheat1_Menu() { - HMI_value.Select = 0; - if (!PreheatMenu) PreheatMenu = new MenuClass(); - Draw_Preheat_Menu({59, 16, 81, 14}, F(PREHEAT_1_LABEL " Preheat Settings")); // TODO: English "PLA Settings" JPG + UpdateMenu(PreheatMenu); } - #if PREHEAT_COUNT >= 2 - void Draw_Preheat2_Menu() { - HMI_value.Select = 1; - if (!PreheatMenu) PreheatMenu = new MenuClass(); - Draw_Preheat_Menu({142, 16, 82, 14}, F(PREHEAT_2_LABEL " Preheat Settings")); // TODO: English "ABS Settings" JPG - } - #endif - - #if PREHEAT_COUNT >= 3 - void Draw_Preheat3_Menu() { - HMI_value.Select = 2; - if (!PreheatMenu) PreheatMenu = new MenuClass(); - Draw_Preheat_Menu({225, 16, 82, 14}, F(PREHEAT_3_LABEL " Preheat Settings")); // TODO: English "... Settings" JPG + #define _Preheat_Menu(N) \ + void Draw_Preheat## N ##_Menu() { \ + HMI_value.Select = N-1; \ + Draw_Preheat_Menu(SET_MENU(PreheatMenu, MSG_PREHEAT_## N ##_SETTINGS, 5)); \ } - #endif + REPEAT_1(PREHEAT_COUNT, _Preheat_Menu) #endif // HAS_PREHEAT void Draw_Temperature_Menu() { checkkey = Menu; - if (!TemperatureMenu) TemperatureMenu = new MenuClass(); - if (CurrentMenu != TemperatureMenu) { - CurrentMenu = TemperatureMenu; - SetMenuTitle({236, 2, 28, 12}, GET_TEXT_F(MSG_TEMPERATURE)); - MenuItemsPrepare(7); + if (SET_MENU_R(TemperatureMenu, selrect({236, 2, 28, 12}), MSG_TEMPERATURE, 4 + PREHEAT_COUNT)) { BACK_ITEM(Draw_Control_Menu); #if HAS_HOTEND - HotendTargetItem = EDIT_ITEM_F(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); + HotendTargetItem = EDIT_ITEM(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - BedTargetItem = EDIT_ITEM_F(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); + BedTargetItem = EDIT_ITEM(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN - FanSpeedItem = EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); + FanSpeedItem = EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); #endif #if HAS_PREHEAT - MENU_ITEM_F(ICON_SetPLAPreheat, MSG_PREHEAT_1_SETTINGS, onDrawPLAPreheatSubMenu, Draw_Preheat1_Menu); - #if PREHEAT_COUNT >= 2 - MENU_ITEM_F(ICON_SetABSPreheat, MSG_PREHEAT_2_SETTINGS, onDrawABSPreheatSubMenu, Draw_Preheat2_Menu); - #if PREHEAT_COUNT >= 3 - MENU_ITEM_F(ICON_SetCustomPreheat, MSG_PREHEAT_3_SETTINGS, onDrawSubMenu, Draw_Preheat3_Menu); - #endif - #endif + #define _ITEM_SETPREHEAT(N) MENU_ITEM(ICON_SetPreheat##N, MSG_PREHEAT_## N ##_SETTINGS, onDrawSubMenu, Draw_Preheat## N ##_Menu); + REPEAT_1(PREHEAT_COUNT, _ITEM_SETPREHEAT) #endif } - CurrentMenu->draw(); + UpdateMenu(TemperatureMenu); } void Draw_MaxSpeed_Menu() { checkkey = Menu; - if (!MaxSpeedMenu) MaxSpeedMenu = new MenuClass(); - if (CurrentMenu != MaxSpeedMenu) { - CurrentMenu = MaxSpeedMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAX_SPEED)); - MenuItemsPrepare(5); + if (SET_MENU_R(MaxSpeedMenu, selrect({1, 16, 28, 13}), MSG_MAX_SPEED, 5)) { BACK_ITEM(Draw_Motion_Menu); - EDIT_ITEM_F(ICON_MaxSpeedX, MSG_VMAX_A, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); - EDIT_ITEM_F(ICON_MaxSpeedY, MSG_VMAX_B, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); - EDIT_ITEM_F(ICON_MaxSpeedZ, MSG_VMAX_C, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + EDIT_ITEM(ICON_MaxSpeedX, MSG_VMAX_A, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); + EDIT_ITEM(ICON_MaxSpeedY, MSG_VMAX_B, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); + EDIT_ITEM(ICON_MaxSpeedZ, MSG_VMAX_C, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM_F(ICON_MaxSpeedE, MSG_VMAX_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); + EDIT_ITEM(ICON_MaxSpeedE, MSG_VMAX_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); #endif } - CurrentMenu->draw(); + UpdateMenu(MaxSpeedMenu); } void Draw_MaxAccel_Menu() { checkkey = Menu; - if (!MaxAccelMenu) MaxAccelMenu = new MenuClass(); - if (CurrentMenu != MaxAccelMenu) { - CurrentMenu = MaxAccelMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_ACCELERATION)); - MenuItemsPrepare(5); + if (SET_MENU_R(MaxAccelMenu, selrect({1, 16, 28, 13}), MSG_AMAX_EN, 5)) { BACK_ITEM(Draw_Motion_Menu); - EDIT_ITEM_F(ICON_MaxAccX, MSG_AMAX_A, onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); - EDIT_ITEM_F(ICON_MaxAccY, MSG_AMAX_B, onDrawMaxAccelY, SetMaxAccelY, &planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); - EDIT_ITEM_F(ICON_MaxAccZ, MSG_AMAX_C, onDrawMaxAccelZ, SetMaxAccelZ, &planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + EDIT_ITEM(ICON_MaxAccX, MSG_AMAX_A, onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + EDIT_ITEM(ICON_MaxAccY, MSG_AMAX_B, onDrawMaxAccelY, SetMaxAccelY, &planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + EDIT_ITEM(ICON_MaxAccZ, MSG_AMAX_C, onDrawMaxAccelZ, SetMaxAccelZ, &planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM_F(ICON_MaxAccE, MSG_AMAX_E, onDrawMaxAccelE, SetMaxAccelE, &planner.settings.max_acceleration_mm_per_s2[E_AXIS]); + EDIT_ITEM(ICON_MaxAccE, MSG_AMAX_E, onDrawMaxAccelE, SetMaxAccelE, &planner.settings.max_acceleration_mm_per_s2[E_AXIS]); #endif } - CurrentMenu->draw(); + UpdateMenu(MaxAccelMenu); } #if HAS_CLASSIC_JERK void Draw_MaxJerk_Menu() { checkkey = Menu; - if (!MaxJerkMenu) MaxJerkMenu = new MenuClass(); - if (CurrentMenu != MaxJerkMenu) { - CurrentMenu = MaxJerkMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK)); - MenuItemsPrepare(5); + if (SET_MENU_R(MaxJerkMenu, selrect({1, 16, 28, 13}), MSG_JERK, 5)) { BACK_ITEM(Draw_Motion_Menu); - EDIT_ITEM_F(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk.x); - EDIT_ITEM_F(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk.y); - EDIT_ITEM_F(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk.z); + EDIT_ITEM(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk.x); + EDIT_ITEM(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk.y); + EDIT_ITEM(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk.z); #if HAS_HOTEND - EDIT_ITEM_F(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk.e); + EDIT_ITEM(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk.e); #endif } - CurrentMenu->draw(); + UpdateMenu(MaxJerkMenu); } #endif void Draw_Steps_Menu() { checkkey = Menu; - if (!StepsMenu) StepsMenu = new MenuClass(); - if (CurrentMenu != StepsMenu) { - CurrentMenu = StepsMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_STEPS_PER_MM)); - MenuItemsPrepare(5); + if (SET_MENU_R(StepsMenu, selrect({1, 16, 28, 13}), MSG_STEPS_PER_MM, 5)) { BACK_ITEM(Draw_Motion_Menu); - EDIT_ITEM_F(ICON_StepX, MSG_A_STEPS, onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); - EDIT_ITEM_F(ICON_StepY, MSG_B_STEPS, onDrawStepsY, SetStepsY, &planner.settings.axis_steps_per_mm[Y_AXIS]); - EDIT_ITEM_F(ICON_StepZ, MSG_C_STEPS, onDrawStepsZ, SetStepsZ, &planner.settings.axis_steps_per_mm[Z_AXIS]); + EDIT_ITEM(ICON_StepX, MSG_A_STEPS, onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); + EDIT_ITEM(ICON_StepY, MSG_B_STEPS, onDrawStepsY, SetStepsY, &planner.settings.axis_steps_per_mm[Y_AXIS]); + EDIT_ITEM(ICON_StepZ, MSG_C_STEPS, onDrawStepsZ, SetStepsZ, &planner.settings.axis_steps_per_mm[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM_F(ICON_StepE, MSG_E_STEPS, onDrawStepsE, SetStepsE, &planner.settings.axis_steps_per_mm[E_AXIS]); + EDIT_ITEM(ICON_StepE, MSG_E_STEPS, onDrawStepsE, SetStepsE, &planner.settings.axis_steps_per_mm[E_AXIS]); #endif } - CurrentMenu->draw(); + UpdateMenu(StepsMenu); } #if ENABLED(PIDTEMP) void Draw_HotendPID_Menu() { checkkey = Menu; - if (SetMenu(HotendPIDMenu, F(STR_HOTEND_PID " Settings"), 8)) { + if (SET_MENU_F(HotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { BACK_ITEM(Draw_AdvancedSettings_Menu); - MENU_ITEM(ICON_PIDNozzle, F(STR_HOTEND_PID), onDrawMenuItem, HotendPID); - EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp); - EDIT_ITEM(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki); - EDIT_ITEM(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd); - EDIT_ITEM_F(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, SetHotendPidT, &HMI_data.HotendPidT); - EDIT_ITEM_F(ICON_PIDcycles, MSG_PID_CYCLE, onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); + MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID, onDrawMenuItem, HotendPID); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, SetHotendPidT, &HMI_data.HotendPidT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); #endif } UpdateMenu(HotendPIDMenu); @@ -3692,30 +3484,30 @@ void Draw_Steps_Menu() { #if ENABLED(PIDTEMPBED) void Draw_BedPID_Menu() { checkkey = Menu; - if (SetMenu(BedPIDMenu, F(STR_BED_PID " Settings"), 8)) { + if (SET_MENU_F(BedPIDMenu, STR_BED_PID " Settings", 8)) { BACK_ITEM(Draw_AdvancedSettings_Menu); - MENU_ITEM(ICON_PIDNozzle, F(STR_BED_PID), onDrawMenuItem,BedPID); - EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp); - EDIT_ITEM(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki); - EDIT_ITEM(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd); - EDIT_ITEM_F(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, SetBedPidT, &HMI_data.BedPidT); - EDIT_ITEM_F(ICON_PIDcycles, MSG_PID_CYCLE, onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); + MENU_ITEM_F(ICON_PIDBed, STR_BED_PID, onDrawMenuItem,BedPID); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, SetBedPidT, &HMI_data.BedPidT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); #endif } UpdateMenu(BedPIDMenu); } #endif -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) +#if HAS_BED_PROBE void Draw_ZOffsetWiz_Menu() { checkkey = Menu; - if (SetMenu(ZOffsetWizMenu, GET_TEXT_F(MSG_PROBE_WIZARD), 4)) { + if (SET_MENU(ZOffsetWizMenu, MSG_PROBE_WIZARD, 4)) { BACK_ITEM(Draw_Prepare_Menu); - MENU_ITEM_F(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, AutoHome); - MENU_ITEM(ICON_MoveZ0, F("Move Z to Home"), onDrawMenuItem, SetMoveZto0); - EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); + MENU_ITEM(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, AutoHome); + MENU_ITEM_F(ICON_MoveZ0, "Move Z to Home", onDrawMenuItem, SetMoveZto0); + EDIT_ITEM(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); } UpdateMenu(ZOffsetWizMenu); if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home"); @@ -3725,12 +3517,15 @@ void Draw_Steps_Menu() { #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) void Draw_Homing_Menu() { checkkey = Menu; - if (SetMenu(HomingMenu, GET_TEXT_F(MSG_HOMING), 5)) { + if (SET_MENU(HomingMenu, MSG_HOMING, 6)) { BACK_ITEM(Draw_Prepare_Menu); - MENU_ITEM_F(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, AutoHome); - MENU_ITEM_F(ICON_HomeX, MSG_AUTO_HOME_X, onDrawMenuItem, HomeX); - MENU_ITEM_F(ICON_HomeY, MSG_AUTO_HOME_Y, onDrawMenuItem, HomeY); - MENU_ITEM_F(ICON_HomeZ, MSG_AUTO_HOME_Z, onDrawMenuItem, HomeZ); + MENU_ITEM(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, AutoHome); + MENU_ITEM(ICON_HomeX, MSG_AUTO_HOME_X, onDrawMenuItem, HomeX); + MENU_ITEM(ICON_HomeY, MSG_AUTO_HOME_Y, onDrawMenuItem, HomeY); + MENU_ITEM(ICON_HomeZ, MSG_AUTO_HOME_Z, onDrawMenuItem, HomeZ); + #if ENABLED(MESH_BED_LEVELING) + EDIT_ITEM(ICON_ZAfterHome, MSG_Z_AFTER_HOME, onDrawPInt8Menu, SetZAfterHoming, &HMI_data.z_after_homing); + #endif } UpdateMenu(HomingMenu); } @@ -3739,13 +3534,13 @@ void Draw_Steps_Menu() { #if ENABLED(FWRETRACT) void Draw_FWRetract_Menu() { checkkey = Menu; - if (SetMenu(FWRetractMenu, GET_TEXT_F(MSG_FWRETRACT), 6)) { + if (SET_MENU(FWRetractMenu, MSG_FWRETRACT, 6)) { BACK_ITEM(Return_FWRetract_Menu); - EDIT_ITEM_F(ICON_FWRetLength, MSG_CONTROL_RETRACT, onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); - EDIT_ITEM_F(ICON_FWRetSpeed, MSG_SINGLENOZZLE_RETRACT_SPEED, onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); - EDIT_ITEM_F(ICON_FWRetZRaise, MSG_CONTROL_RETRACT_ZHOP, onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); - EDIT_ITEM_F(ICON_FWRecSpeed, MSG_SINGLENOZZLE_UNRETRACT_SPEED, onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); - EDIT_ITEM_F(ICON_FWRecExtra, MSG_CONTROL_RETRACT_RECOVER, onDrawPFloatMenu, SetAddRecover, &fwretract.settings.retract_recover_extra); + EDIT_ITEM(ICON_FWRetLength, MSG_CONTROL_RETRACT, onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); + EDIT_ITEM(ICON_FWRetSpeed, MSG_SINGLENOZZLE_RETRACT_SPEED, onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); + EDIT_ITEM(ICON_FWRetZRaise, MSG_CONTROL_RETRACT_ZHOP, onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); + EDIT_ITEM(ICON_FWRecSpeed, MSG_SINGLENOZZLE_UNRETRACT_SPEED, onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); + EDIT_ITEM(ICON_FWRecExtra, MSG_CONTROL_RETRACT_RECOVER, onDrawPFloatMenu, SetAddRecover, &fwretract.settings.retract_recover_extra); } UpdateMenu(FWRetractMenu); } @@ -3766,7 +3561,7 @@ void Draw_Steps_Menu() { DWIN_UpdateLCD(); } - #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + #if ENABLED(PREHEAT_BEFORE_LEVELING) void SetBedLevT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif @@ -3774,11 +3569,11 @@ void Draw_Steps_Menu() { #define Z_OFFSET_MIN -3 #define Z_OFFSET_MAX 3 - void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? BedLevelTools.mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : BedLevelTools.mesh_y]; EditZValueItem->redraw(); } - void ApplyEditMeshX() { BedLevelTools.mesh_x = MenuData.Value; } - void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, BedLevelTools.mesh_x, ApplyEditMeshX, LiveEditMesh); } - void ApplyEditMeshY() { BedLevelTools.mesh_y = MenuData.Value; } - void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, BedLevelTools.mesh_y, ApplyEditMeshY, LiveEditMesh); } + void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? bedLevelTools.mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : bedLevelTools.mesh_y]; EditZValueItem->redraw(); } + void ApplyEditMeshX() { bedLevelTools.mesh_x = MenuData.Value; } + void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, bedLevelTools.mesh_x, ApplyEditMeshX, LiveEditMesh); } + void ApplyEditMeshY() { bedLevelTools.mesh_y = MenuData.Value; } + void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, bedLevelTools.mesh_y, ApplyEditMeshY, LiveEditMesh); } void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } #endif #endif @@ -3792,14 +3587,14 @@ void Draw_Steps_Menu() { onDrawIntMenu(menuitem, line, bedlevel.storage_slot); } - void ApplyUBLTiltGrid() { BedLevelTools.tilt_grid = MenuData.Value; } - void SetUBLTiltGrid() { SetIntOnClick(1, 3, BedLevelTools.tilt_grid, ApplyUBLTiltGrid); } + void ApplyUBLTiltGrid() { bedLevelTools.tilt_grid = MenuData.Value; } + void SetUBLTiltGrid() { SetIntOnClick(1, 3, bedLevelTools.tilt_grid, ApplyUBLTiltGrid); } void UBLTiltMesh() { if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; char buf[15]; - if (BedLevelTools.tilt_grid > 1) { - sprintf_P(buf, PSTR("G28O\nG29 J%i"), BedLevelTools.tilt_grid); + if (bedLevelTools.tilt_grid > 1) { + sprintf_P(buf, PSTR("G28O\nG29 J%i"), bedLevelTools.tilt_grid); gcode.process_subcommands_now(buf); } else @@ -3830,28 +3625,28 @@ void Draw_Steps_Menu() { void Draw_MeshSet_Menu() { checkkey = Menu; - if (SetMenu(MeshMenu, GET_TEXT_F(MSG_MESH_LEVELING), 15)) { + if (SET_MENU(MeshMenu, MSG_MESH_LEVELING, 13)) { BACK_ITEM(Draw_AdvancedSettings_Menu); - #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) - EDIT_ITEM_F(ICON_Temperature, MSG_UBL_SET_TEMP_BED, onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT); + #if ENABLED(PREHEAT_BEFORE_LEVELING) + EDIT_ITEM(ICON_Temperature, MSG_UBL_SET_TEMP_BED, onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT); #endif - EDIT_ITEM_F(ICON_SetZOffset, MSG_Z_FADE_HEIGHT, onDrawPFloatMenu, SetMeshFadeHeight, &planner.z_fade_height); - EDIT_ITEM_F(ICON_UBLActive, MSG_ACTIVATE_MESH, onDrawChkbMenu, SetMeshActive, &planner.leveling_active); + EDIT_ITEM(ICON_SetZOffset, MSG_Z_FADE_HEIGHT, onDrawPFloatMenu, SetMeshFadeHeight, &planner.z_fade_height); + EDIT_ITEM(ICON_UBLActive, MSG_ACTIVATE_MESH, onDrawChkbMenu, SetMeshActive, &planner.leveling_active); #if HAS_BED_PROBE - MENU_ITEM_F(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); + MENU_ITEM(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot); - MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); - MENU_ITEM_F(ICON_UBLActive, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); - EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &BedLevelTools.tilt_grid); - MENU_ITEM_F(ICON_UBLActive, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh); - MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh); + EDIT_ITEM(ICON_UBLSlot, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot); + MENU_ITEM(ICON_UBLSaveMesh, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); + MENU_ITEM(ICON_UBLLoadMesh, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); + EDIT_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &bedLevelTools.tilt_grid); + MENU_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh); + MENU_ITEM(ICON_UBLSmartFill, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh); #endif #if ENABLED(MESH_EDIT_MENU) - MENU_ITEM_F(ICON_UBLActive, MSG_EDIT_MESH, onDrawSubMenu, Draw_EditMesh_Menu); + MENU_ITEM(ICON_MeshEdit, MSG_EDIT_MESH, onDrawSubMenu, Draw_EditMesh_Menu); #endif - MENU_ITEM_F(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer); + MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer); } UpdateMenu(MeshMenu); } @@ -3861,12 +3656,12 @@ void Draw_Steps_Menu() { if (!leveling_is_valid()) { LCD_MESSAGE(MSG_UBL_MESH_INVALID); return; } set_bed_leveling_enabled(false); checkkey = Menu; - if (SetMenu(EditMeshMenu, GET_TEXT_F(MSG_EDIT_MESH), 4)) { - BedLevelTools.mesh_x = BedLevelTools.mesh_y = 0; + if (SET_MENU(EditMeshMenu, MSG_EDIT_MESH, 4)) { + bedLevelTools.mesh_x = bedLevelTools.mesh_y = 0; BACK_ITEM(Draw_MeshSet_Menu); - EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX,&BedLevelTools.mesh_x); - EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY,&BedLevelTools.mesh_y); - EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &bedlevel.z_values[BedLevelTools.mesh_x][BedLevelTools.mesh_y]); + EDIT_ITEM(ICON_MeshEditX, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX, &bedLevelTools.mesh_x); + EDIT_ITEM(ICON_MeshEditY, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY, &bedLevelTools.mesh_y); + EditZValueItem = EDIT_ITEM(ICON_MeshEditZ, MSG_MESH_EDIT_Z, onDrawPFloat2Menu, SetEditZValue, &bedlevel.z_values[bedLevelTools.mesh_x][bedLevelTools.mesh_y]); } UpdateMenu(EditMeshMenu); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index f4c06186916d0..50be4a8ba5a21 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -24,16 +24,25 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.17.2 - * Date: 2022/04/08 + * Version: 3.21.2 + * Date: 2022/12/02 */ +#include "../../../inc/MarlinConfig.h" + #include "dwin_defines.h" #include "dwinui.h" #include "../common/encoder.h" #include "../../../libs/BL24CXX.h" -#include "../../../inc/MarlinConfig.h" +namespace GET_LANG(LCD_LANGUAGE) { + #define _MSG_PREHEAT(N) \ + LSTR MSG_PREHEAT_##N = _UxGT("Preheat ") PREHEAT_## N ##_LABEL; \ + LSTR MSG_PREHEAT_## N ##_SETTINGS = _UxGT("Preheat ") PREHEAT_## N ##_LABEL _UxGT(" Conf"); + #if PREHEAT_COUNT > 3 + REPEAT_S(4, PREHEAT_COUNT, _MSG_PREHEAT) + #endif +} enum processID : uint8_t { // Process ID @@ -44,7 +53,6 @@ enum processID : uint8_t { SetIntNoDraw, SetFloat, SetPFloat, - SelectFile, PrintProcess, Popup, Leveling, @@ -59,33 +67,88 @@ enum processID : uint8_t { }; enum pidresult_t : uint8_t { + PIDTEMP_START = 0, + PIDTEMPBED_START, PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, - PID_EXTR_START, - PID_BED_START, - PID_DONE + PID_DONE, }; #define DWIN_CHINESE 123 #define DWIN_ENGLISH 0 +typedef struct { + // Color settings + uint16_t Background_Color; + uint16_t Cursor_Color; + uint16_t TitleBg_Color; + uint16_t TitleTxt_Color; + uint16_t Text_Color; + uint16_t Selected_Color; + uint16_t SplitLine_Color; + uint16_t Highlight_Color; + uint16_t StatusBg_Color; + uint16_t StatusTxt_Color; + uint16_t PopupBg_Color; + uint16_t PopupTxt_Color; + uint16_t AlertBg_Color; + uint16_t AlertTxt_Color; + uint16_t PercentTxt_Color; + uint16_t Barfill_Color; + uint16_t Indicator_Color; + uint16_t Coordinate_Color; + + // Temperatures + #if ENABLED(PIDTEMP) + int16_t HotendPidT = DEF_HOTENDPIDT; + #endif + #if ENABLED(PIDTEMPBED) + int16_t BedPidT = DEF_BEDPIDT; + #endif + #if (HAS_HOTEND || HAS_HEATED_BED) && HAS_PID_HEATING + int16_t PidCycles = DEF_PIDCYCLES; + #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + int16_t ExtMinT = EXTRUDE_MINTEMP; + #endif + #if ENABLED(PREHEAT_BEFORE_LEVELING) + int16_t BedLevT = LEVELING_BED_TEMP; + #endif + #if ENABLED(BAUD_RATE_GCODE) + bool Baud115K = false; + #endif + bool FullManualTramming = false; + bool MediaAutoMount = ENABLED(HAS_SD_EXTENDER); + #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) + uint8_t z_after_homing = DEF_Z_AFTER_HOMING; + #endif + #if ENABLED(MESH_BED_LEVELING) + float ManualZOffset = 0; + #endif + // Led + #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) + LEDColor Led_Color = Def_Leds_Color; + #endif +} HMI_data_t; + +extern HMI_data_t HMI_data; +static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); + typedef struct { int8_t Color[3]; // Color components - pidresult_t pidresult = PID_DONE; + TERN_(HAS_PID_HEATING, pidresult_t pidresult = PID_DONE); uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select } HMI_value_t; typedef struct { uint8_t language; + bool printing_flag:1; // sd or host printing + bool abort_flag:1; // sd or host was aborted + bool pause_flag:1; // printing is paused bool percent_flag:1; // percent was override by M73 bool remain_flag:1; // remain was override by M73 - bool pause_flag:1; // printing is paused - bool pause_action:1; // flag a pause action - bool abort_flag:1; // printing is aborting - bool abort_action:1; // flag a aborting action - bool print_finish:1; // print was finished bool select_flag:1; // Popup button selected bool home_flag:1; // homing in course bool heat_flag:1; // 0: heating done 1: during heating @@ -105,6 +168,7 @@ extern millis_t dwin_heat_time; #endif // Tool Functions +uint32_t GetHash(char * str); #if ENABLED(EEPROM_SETTINGS) void WriteEeprom(); void ReadEeprom(); @@ -118,15 +182,14 @@ void DisableMotors(); void AutoLev(); void AutoHome(); #if HAS_PREHEAT - void DoPreheat0(); - void DoPreheat1(); - void DoPreheat2(); + #define _DOPREHEAT(N) void DoPreheat##N(); + REPEAT_1(PREHEAT_COUNT, _DOPREHEAT) #endif void DoCoolDown(); -#if HAS_HOTEND +#if ENABLED(PIDTEMP) void HotendPID(); #endif -#if HAS_HEATED_BED +#if ENABLED(PIDTEMPBED) void BedPID(); #endif #if ENABLED(BAUD_RATE_GCODE) @@ -151,6 +214,12 @@ void ParkHead(); void UBLSaveMesh(); void UBLLoadMesh(); #endif +#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) + void HostShutDown(); +#endif +#if !HAS_BED_PROBE + void HomeZandDisable(); +#endif // Other void Goto_PrintProcess(); @@ -160,7 +229,7 @@ void Goto_PowerLossRecovery(); void Goto_ConfirmToPrint(); void DWIN_Draw_Dashboard(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area -void DWIN_DrawStatusLine(); // Draw simple status text +void DWIN_DrawStatusLine(const char *text = ""); // Draw simple status text void DWIN_RedrawDash(); // Redraw Dash and Status line void DWIN_RedrawScreen(); // Redraw all screen elements void HMI_MainMenu(); // Main process screen @@ -169,7 +238,6 @@ void HMI_Printing(); // Print page void HMI_ReturnScreen(); // Return to previous screen before popups void HMI_WaitForUser(); void HMI_SaveProcessID(const uint8_t id); -void HMI_SDCardInit(); void HMI_SDCardUpdate(); void EachMomentUpdate(); void update_variable(); @@ -179,12 +247,11 @@ void DWIN_CheckStatusMessage(); void DWIN_HomingStart(); void DWIN_HomingDone(); #if HAS_MESH - void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval); + void DWIN_MeshUpdate(const int8_t cpos, const int8_t tpos, const_float_t zval); #endif void DWIN_LevelingStart(); void DWIN_LevelingDone(); -void DWIN_PidTuning(pidresult_t result); -void DWIN_Print_Started(const bool sd=false); +void DWIN_Print_Started(); void DWIN_Print_Pause(); void DWIN_Print_Resume(); void DWIN_Print_Finished(); @@ -228,6 +295,7 @@ void DWIN_RebootScreen(); #endif // Menu drawing functions +void Draw_Print_File_Menu(); void Draw_Control_Menu(); void Draw_AdvancedSettings_Menu(); void Draw_Prepare_Menu(); @@ -260,14 +328,6 @@ void Draw_Motion_Menu(); #if ENABLED(MESH_BED_LEVELING) void Draw_ManualMesh_Menu(); #endif -#if HAS_HOTEND - void Draw_Preheat1_Menu(); - void Draw_Preheat2_Menu(); - void Draw_Preheat3_Menu(); - #if ENABLED(PIDTEMP) - void Draw_HotendPID_Menu(); - #endif -#endif void Draw_Temperature_Menu(); void Draw_MaxSpeed_Menu(); void Draw_MaxAccel_Menu(); @@ -275,9 +335,6 @@ void Draw_MaxAccel_Menu(); void Draw_MaxJerk_Menu(); #endif void Draw_Steps_Menu(); -#if ENABLED(PIDTEMPBED) - void Draw_BedPID_Menu(); -#endif #if EITHER(HAS_BED_PROBE, BABYSTEPPING) void Draw_ZOffsetWiz_Menu(); #endif @@ -293,3 +350,12 @@ void Draw_Steps_Menu(); void Draw_EditMesh_Menu(); #endif #endif + +// PID +void DWIN_PidTuning(pidresult_t result); +#if ENABLED(PIDTEMP) + void Draw_HotendPID_Menu(); +#endif +#if ENABLED(PIDTEMPBED) + void Draw_BedPID_Menu(); +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index dffc26478d716..de3f40e2814bf 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -19,44 +19,45 @@ * along with this program. If not, see . * */ -#pragma once - /** * DWIN general defines and data structs for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.11.2 - * Date: 2022/02/28 + * Version: 3.12.2 + * Date: 2022/08/08 */ -#define HAS_GCODE_PREVIEW 1 -#define HAS_PIDPLOT 1 -#define HAS_ESDIAG 1 -#define HAS_LOCKSCREEN 1 +#pragma once + //#define DEBUG_DWIN 1 //#define NEED_HEX_PRINT 1 -#include "../../../inc/MarlinConfigPre.h" -#include "../common/dwin_color.h" -#if ENABLED(LED_CONTROL_MENU) - #include "../../../feature/leds/leds.h" -#endif -#include - #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif +#if DISABLED(PROBE_MANUALLY) && ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + #define HAS_ONESTEP_LEVELING 1 +#endif + +#if !HAS_BED_PROBE && ENABLED(BABYSTEPPING) + #define JUST_BABYSTEP 1 +#endif + +#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET) + #define HAS_ZOFFSET_ITEM 1 +#endif + #define Def_Background_Color RGB( 1, 12, 8) -#define Def_Cursor_color RGB(20, 49, 31) -#define Def_TitleBg_color RGB( 0, 23, 16) -#define Def_TitleTxt_color Color_White +#define Def_Cursor_Color RGB(20, 49, 31) +#define Def_TitleBg_Color RGB( 0, 23, 16) +#define Def_TitleTxt_Color Color_White #define Def_Text_Color Color_White #define Def_Selected_Color Select_Color #define Def_SplitLine_Color RGB( 0, 23, 16) #define Def_Highlight_Color Color_White #define Def_StatusBg_Color RGB( 0, 23, 16) #define Def_StatusTxt_Color Color_Yellow -#define Def_PopupBg_color Color_Bg_Window +#define Def_PopupBg_Color Color_Bg_Window #define Def_PopupTxt_Color Popup_Text_Color #define Def_AlertBg_Color Color_Bg_Red #define Def_AlertTxt_Color Color_Yellow @@ -68,55 +69,15 @@ #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define Def_Leds_Color LEDColorWhite() #endif +#if ENABLED(CASELIGHT_USES_BRIGHTNESS) + #define Def_CaseLight_Brightness 255 +#endif +#ifdef Z_AFTER_HOMING + #define DEF_Z_AFTER_HOMING Z_AFTER_HOMING +#else + #define DEF_Z_AFTER_HOMING 0 +#endif +#define DEF_HOTENDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 195) +#define DEF_BEDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 60) +#define DEF_PIDCYCLES 5 -typedef struct { - // Color settings - uint16_t Background_Color = Def_Background_Color; - uint16_t Cursor_color = Def_Cursor_color; - uint16_t TitleBg_color = Def_TitleBg_color; - uint16_t TitleTxt_color = Def_TitleTxt_color; - uint16_t Text_Color = Def_Text_Color; - uint16_t Selected_Color = Def_Selected_Color; - uint16_t SplitLine_Color = Def_SplitLine_Color; - uint16_t Highlight_Color = Def_Highlight_Color; - uint16_t StatusBg_Color = Def_StatusBg_Color; - uint16_t StatusTxt_Color = Def_StatusTxt_Color; - uint16_t PopupBg_color = Def_PopupBg_color; - uint16_t PopupTxt_Color = Def_PopupTxt_Color; - uint16_t AlertBg_Color = Def_AlertBg_Color; - uint16_t AlertTxt_Color = Def_AlertTxt_Color; - uint16_t PercentTxt_Color = Def_PercentTxt_Color; - uint16_t Barfill_Color = Def_Barfill_Color; - uint16_t Indicator_Color = Def_Indicator_Color; - uint16_t Coordinate_Color = Def_Coordinate_Color; - // Temperatures - #if HAS_HOTEND && defined(PREHEAT_1_TEMP_HOTEND) - int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND; - #endif - #if HAS_HEATED_BED && defined(PREHEAT_1_TEMP_BED) - int16_t BedPidT = PREHEAT_1_TEMP_BED; - #endif - #if HAS_HOTEND || HAS_HEATED_BED - int16_t PidCycles = 10; - #endif - #if ENABLED(PREVENT_COLD_EXTRUSION) - int16_t ExtMinT = EXTRUDE_MINTEMP; - #endif - #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) - int16_t BedLevT = LEVELING_BED_TEMP; - #endif - #if ENABLED(BAUD_RATE_GCODE) - bool Baud115K = false; - #endif - bool FullManualTramming = false; - #if ENABLED(MESH_BED_LEVELING) - float ManualZOffset = 0; - #endif - // Led - #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - LEDColor Led_Color = Def_Leds_Color; - #endif -} HMI_data_t; - -static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); -extern HMI_data_t HMI_data; diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp index 59b6c0d328ae6..552075f9dcb90 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp @@ -46,8 +46,8 @@ uint16_t HighlightYPos = 280; void Draw_Select_Highlight(const bool sel, const uint16_t ypos) { HighlightYPos = ypos; HMI_flag.select_flag = sel; - const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color, - c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color; + const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_Color, + c2 = sel ? HMI_data.PopupBg_Color : HMI_data.Highlight_Color; DWIN_Draw_Rectangle(0, c1, 25, ypos - 1, 126, ypos + 38); DWIN_Draw_Rectangle(0, c1, 24, ypos - 2, 127, ypos + 39); DWIN_Draw_Rectangle(0, c2, 145, ypos - 1, 246, ypos + 38); diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.h b/Marlin/src/lcd/e3v2/proui/dwin_popup.h index b4503ea7866bf..f24aac582e6c6 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.h @@ -44,7 +44,7 @@ void Goto_Popup(const popupDrawFunc_t fnDraw, const popupClickFunc_t fnClick=nul void HMI_Popup(); inline void Draw_Popup_Bkgd() { - DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 60, 258, 330); + DWIN_Draw_Rectangle(1, HMI_data.PopupBg_Color, 14, 60, 258, 330); DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, 14, 60, 258, 330); } diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 5ed36e7dacf05..afb18f24dbc90 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -23,21 +23,17 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.18.1 - * Date: 2022/07/05 + * Version: 3.20.1 + * Date: 2022/10/25 */ -#include "../../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfig.h" #if ENABLED(DWIN_LCD_PROUI) -#include "../../../inc/MarlinConfig.h" +#include "dwin_defines.h" #include "dwin_lcd.h" #include "dwinui.h" -#include "dwin_defines.h" - -//#define DEBUG_OUT 1 -#include "../../../core/debug_out.h" xy_int_t DWINUI::cursor = { 0 }; uint16_t DWINUI::pencolor = Color_White; @@ -50,13 +46,6 @@ FSTR_P const DWINUI::Author = F(STRING_CONFIG_H_AUTHOR); void (*DWINUI::onTitleDraw)(TitleClass* title) = nullptr; void DWINUI::init() { - delay(750); // Delay for wait to wakeup screen - const bool hs = DWIN_Handshake(); UNUSED(hs); - #if ENABLED(DEBUG_DWIN) - SERIAL_ECHOPGM("DWIN_Handshake "); - SERIAL_ECHOLNF(hs ? F("ok.") : F("error.")); - #endif - DWIN_Frame_SetDir(1); cursor.reset(); pencolor = Color_White; textcolor = Def_Text_Color; @@ -210,6 +199,19 @@ void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t c DWIN_Draw_String(bShow, fid, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr)); } +// ------------------------- Icons -------------------------------// + +// Draw an Icon and select library automatically +// BG: The icon background display: false=Background filtering is not displayed, true=Background display +// libID: Icon library ID +// picID: Icon ID +// x/y: Upper-left point +void DWINUI::ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y) { + const uint8_t libID = ICON TERN_(HAS_CUSTOMICONS, + (icon / 100)); + const uint8_t picID = icon TERN_(HAS_CUSTOMICONS, % 100); + DWIN_ICON_Show(BG, false, !BG, libID, picID, x, y); +} + // ------------------------- Buttons ------------------------------// void DWINUI::Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) { @@ -320,8 +322,8 @@ uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) { // x/y: Upper-left point // mode : 0 : unchecked, 1 : checked void DWINUI::Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool checked=false) { - DWIN_Draw_String(true, font8x16, color, bcolor, x + 4, y, checked ? F("x") : F(" ")); DWIN_Draw_Rectangle(0, color, x + 2, y + 2, x + 17, y + 17); + DWIN_Draw_Rectangle(1, checked ? color : bcolor, x + 6, y + 6, x + 13, y + 13); } // Clear Menu by filling the menu area with background color diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index a5444718312ce..3dd37f30dfe6a 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -19,7 +19,6 @@ * along with this program. If not, see . * */ -#pragma once /** * DWIN Enhanced implementation for PRO UI @@ -28,10 +27,14 @@ * Date: 2022/07/05 */ -#include "dwin_lcd.h" +#pragma once + +#include "../../../inc/MarlinConfigPre.h" + #include "../common/dwin_set.h" #include "../common/dwin_font.h" #include "../common/dwin_color.h" +#include "dwin_lcd.h" // Extra Icons #define ICON_AdvSet ICON_Language @@ -74,6 +77,10 @@ #define ICON_MaxPosX ICON_MoveX #define ICON_MaxPosY ICON_MoveY #define ICON_MaxPosZ ICON_MoveZ +#define ICON_MeshEdit ICON_Homing +#define ICON_MeshEditX ICON_MoveX +#define ICON_MeshEditY ICON_MoveY +#define ICON_MeshEditZ ICON_MoveZ #define ICON_MeshNext ICON_Axis #define ICON_MeshPoints ICON_SetEndTemp #define ICON_MeshSave ICON_WriteEEPROM @@ -85,11 +92,22 @@ #define ICON_ParkPosY ICON_StepY #define ICON_ParkPosZ ICON_StepZ #define ICON_PhySet ICON_PrintSize -#define ICON_PIDbed ICON_SetBedTemp -#define ICON_PIDcycles ICON_ResumeEEPROM +#define ICON_PIDNozzle ICON_SetEndTemp +#define ICON_PIDBed ICON_SetBedTemp +#define ICON_PIDCycles ICON_ResumeEEPROM #define ICON_PIDValue ICON_Contact #define ICON_PrintStats ICON_PrintTime #define ICON_PrintStatsReset ICON_RemainTime +#define ICON_Preheat1 ICON_PLAPreheat +#define ICON_Preheat2 ICON_ABSPreheat +#define ICON_Preheat3 ICON_CustomPreheat +#define ICON_Preheat4 ICON_CustomPreheat +#define ICON_Preheat5 ICON_CustomPreheat +#define ICON_Preheat6 ICON_CustomPreheat +#define ICON_Preheat7 ICON_CustomPreheat +#define ICON_Preheat8 ICON_CustomPreheat +#define ICON_Preheat9 ICON_CustomPreheat +#define ICON_Preheat10 ICON_CustomPreheat #define ICON_ProbeDeploy ICON_SetEndTemp #define ICON_ProbeMargin ICON_PrintSize #define ICON_ProbeOffsetX ICON_StepX @@ -105,9 +123,28 @@ #define ICON_Scolor ICON_MaxSpeed #define ICON_SetBaudRate ICON_Setspeed #define ICON_SetCustomPreheat ICON_SetEndTemp +#define ICON_SetPreheat1 ICON_SetPLAPreheat +#define ICON_SetPreheat2 ICON_SetABSPreheat +#define ICON_SetPreheat3 ICON_SetCustomPreheat +#define ICON_SetPreheat4 ICON_SetCustomPreheat +#define ICON_SetPreheat5 ICON_SetCustomPreheat +#define ICON_SetPreheat6 ICON_SetCustomPreheat +#define ICON_SetPreheat7 ICON_SetCustomPreheat +#define ICON_SetPreheat8 ICON_SetCustomPreheat +#define ICON_SetPreheat9 ICON_SetCustomPreheat +#define ICON_SetPreheat10 ICON_SetCustomPreheat #define ICON_Sound ICON_Cool #define ICON_TBSetup ICON_Contact #define ICON_UBLActive ICON_HotendTemp +#define ICON_UBLActive ICON_HotendTemp +#define ICON_UBLSlot ICON_ResumeEEPROM +#define ICON_UBLSaveMesh ICON_WriteEEPROM +#define ICON_UBLLoadMesh ICON_ReadEEPROM +#define ICON_UBLTiltGrid ICON_PrintSize +#define ICON_UBLSmartFill ICON_StockConfiguration +#define ICON_ZAfterHome ICON_SetEndTemp + + #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion @@ -262,18 +299,25 @@ namespace DWINUI { return t; } + // Draw an Icon and select library automatically + // BG: The icon background display: false=Background filtering is not displayed, true=Background display + // libID: Icon library ID + // picID: Icon ID + // x/y: Upper-left point + void ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y); + // Draw an Icon with transparent background from the library ICON // icon: Icon ID // x/y: Upper-left point inline void Draw_Icon(uint8_t icon, uint16_t x, uint16_t y) { - DWIN_ICON_Show(ICON, icon, x, y); + ICON_Show(false, icon, x, y); } // Draw an Icon from the library ICON with its background // icon: Icon ID // x/y: Upper-left point inline void Draw_IconWB(uint8_t icon, uint16_t x, uint16_t y) { - DWIN_ICON_Show(true, false, false, ICON, icon, x, y); + ICON_Show(true, icon, x, y); } // Draw a numeric integer value diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 19d726037ce94..0945d69778140 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -23,17 +23,13 @@ /** * DWIN Endstops diagnostic page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.2.2 - * Date: 2022/02/24 + * Version: 1.3.3 + * Date: 2022/10/07 */ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_LCD_PROUI) - -#include "dwin_defines.h" - -#if HAS_ESDIAG +#if BOTH(DWIN_LCD_PROUI, HAS_ESDIAG) #include "endstop_diag.h" @@ -64,7 +60,7 @@ void draw_es_label(FSTR_P const flabel=nullptr) { void draw_es_state(const bool is_hit) { const uint8_t LM = 130; DWINUI::cursor.x = LM; - DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, LM, DWINUI::cursor.y, LM + 100, DWINUI::cursor.y + 20); + DWIN_Draw_Rectangle(1, HMI_data.PopupBg_Color, LM, DWINUI::cursor.y, LM + 100, DWINUI::cursor.y + 20); is_hit ? DWINUI::Draw_String(RGB(31,31,16), F(STR_ENDSTOP_HIT)) : DWINUI::Draw_String(RGB(16,63,16), F(STR_ENDSTOP_OPEN)); DWINUI::MoveBy(0, 25); } @@ -109,5 +105,4 @@ void ESDiagClass::Update() { DWIN_UpdateLCD(); } -#endif // HAS_ESDIAG -#endif // DWIN_LCD_PROUI +#endif // DWIN_LCD_PROUI && HAS_ESDIAG diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.h b/Marlin/src/lcd/e3v2/proui/endstop_diag.h index 316a1e1ed3d9f..33f1d10d2da57 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.h +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.h @@ -24,8 +24,8 @@ /** * DWIN End Stops diagnostic page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.2.3 - * Date: 2022/02/24 + * Version: 1.3.2 + * Date: 2022/10/07 */ class ESDiagClass { diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index adb23a96646b9..6411b669bbc8f 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -23,8 +23,8 @@ /** * DWIN g-code thumbnail preview * Author: Miguel A. Risco-Castillo - * version: 2.1 - * Date: 2021/06/19 + * version: 3.1.2 + * Date: 2022/09/03 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -43,11 +43,8 @@ */ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_LCD_PROUI) -#include "dwin_defines.h" - -#if HAS_GCODE_PREVIEW +#if BOTH(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW) #include "../../../core/types.h" #include "../../marlinui.h" @@ -246,6 +243,10 @@ void Preview_DrawFromSD() { } } +void Preview_Invalidate() { + fileprop.thumbstart = 0; +} + bool Preview_Valid() { return !!fileprop.thumbstart; } @@ -254,5 +255,4 @@ void Preview_Reset() { fileprop.thumbsize = 0; } -#endif // HAS_GCODE_PREVIEW -#endif // DWIN_LCD_PROUI +#endif // HAS_GCODE_PREVIEW && DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index 4417084a242dc..c1949c5abc12c 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -1,8 +1,8 @@ /** * DWIN g-code thumbnail preview * Author: Miguel A. Risco-Castillo - * version: 2.1 - * Date: 2021/06/19 + * version: 3.1.2 + * Date: 2022/09/03 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -23,5 +23,6 @@ #pragma once void Preview_DrawFromSD(); +void Preview_Invalidate(); bool Preview_Valid(); void Preview_Reset(); diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 86c2095294b4b..85f35582b2683 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -23,18 +23,15 @@ /** * Lock screen implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 2.2.0 - * Date: 2022/04/11 + * Version: 2.3.2 + * Date: 2022/11/20 */ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_LCD_PROUI) +#if BOTH(DWIN_LCD_PROUI, HAS_LOCKSCREEN) #include "dwin_defines.h" - -#if HAS_LOCKSCREEN - #include "dwinui.h" #include "dwin.h" #include "lockscreen.h" @@ -75,6 +72,4 @@ void LockScreenClass::onEncoder(EncoderState encoder_diffState) { DWIN_UpdateLCD(); } -#endif // HAS_LOCKSCREEN - -#endif // DWIN_LCD_PROUI +#endif // DWIN_LCD_PROUI && HAS_LOCKSCREEN diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.h b/Marlin/src/lcd/e3v2/proui/lockscreen.h index 83d5530be3e46..cb75f2c7c0db0 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.h +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.h @@ -24,8 +24,8 @@ /** * Lock screen implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 2.2.0 - * Date: 2022/04/11 + * Version: 2.3.2 + * Date: 2022/11/20 */ #include "../common/encoder.h" diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 85594fecdbab1..3267eec60d33d 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -23,8 +23,8 @@ /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo - * Version: 1.5.1 - * Date: 2022/05/23 + * Version: 1.9.1 + * Date: 2022/12/02 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -53,22 +53,23 @@ int8_t MenuItemTotal = 0; int8_t MenuItemCount = 0; -MenuItemClass** MenuItems = nullptr; +CustomMenuItemClass** MenuItems = nullptr; MenuClass *CurrentMenu = nullptr; MenuClass *PreviousMenu = nullptr; -void (*onMenuDraw)(MenuClass* menu) = nullptr; -void (*onCursorErase)(const int8_t line) = nullptr; -void (*onCursorDraw)(const int8_t line) = nullptr; MenuData_t MenuData; // Menuitem Drawing functions ================================================= void Draw_Title(TitleClass* title) { - DWIN_Draw_Rectangle(1, HMI_data.TitleBg_color, 0, 0, DWIN_WIDTH - 1, TITLE_HEIGHT - 1); + DWIN_Draw_Rectangle(1, HMI_data.TitleBg_Color, 0, 0, DWIN_WIDTH - 1, TITLE_HEIGHT - 1); if (title->frameid) DWIN_Frame_AreaCopy(title->frameid, title->frame.left, title->frame.top, title->frame.right, title->frame.bottom, 14, (TITLE_HEIGHT - (title->frame.bottom - title->frame.top)) / 2 - 1); else - DWIN_Draw_String(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_color, HMI_data.TitleBg_color, 14, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption); + #if ENABLED(TITLE_CENTERED) + DWINUI::Draw_CenteredString(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_Color, HMI_data.TitleBg_Color, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption); + #else + DWIN_Draw_String(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_Color, HMI_data.TitleBg_Color, 14, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption); + #endif } void Draw_Menu(MenuClass* menu) { @@ -78,7 +79,7 @@ void Draw_Menu(MenuClass* menu) { void Draw_Menu_Cursor(const int8_t line) { const uint16_t ypos = MYPOS(line); - DWINUI::Draw_Box(1, HMI_data.Cursor_color, {0, ypos, 15, MLINE - 1}); + DWINUI::Draw_Box(1, HMI_data.Cursor_Color, {0, ypos, 15, MLINE - 1}); } void Erase_Menu_Cursor(const int8_t line) { @@ -86,17 +87,39 @@ void Erase_Menu_Cursor(const int8_t line) { DWINUI::Draw_Box(1, HMI_data.Background_Color, {0, ypos, 15, MLINE - 1}); } -void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * const label /*=nullptr*/, bool more /*=false*/) { +void Erase_Menu_Text(const int8_t line) { + if (line < 0 || line >= TROWS) return; + const uint16_t ypos = MYPOS(line) + 1; + DWINUI::Draw_Box(1, HMI_data.Background_Color, {LBLX, ypos, DWIN_WIDTH - LBLX, MLINE - 2}); +} + +void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * const label /*=nullptr*/, bool more /*=false*/, bool selected /*=false*/) { if (icon) DWINUI::Draw_Icon(icon, ICOX, MBASE(line) - 3); if (label) DWINUI::Draw_String(LBLX, MBASE(line) - 1, (char*)label); if (more) DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3); + if (selected) Draw_Menu_Cursor(line); DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } +void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, FSTR_P label /*=nullptr*/, bool more /*=false*/, bool selected /*=false*/) { + Draw_Menu_Line(line, icon, FTOP(label), more, selected); +} + void Draw_Chkb_Line(const uint8_t line, const bool checked) { DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 3 * DWINUI::fontWidth(), MBASE(line) - 1, checked); } +void Show_Chkb_Line(const bool checked) { + const uint8_t line = CurrentMenu->line(); + DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 3 * DWINUI::fontWidth(), MBASE(line) - 1, checked); + DWIN_UpdateLCD(); +} + +void Toogle_Chkb_Line(bool &checked) { + checked = !checked; + Show_Chkb_Line(checked); +} + void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value /*=0*/) { DWINUI::Draw_Signed_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(line) - 1, value); } @@ -140,22 +163,11 @@ void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const flo DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(line), value); } -void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line) { +void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp) { const float value = *(float*)static_cast(menuitem)->value; - const int8_t dp = UNITFDIGITS; onDrawFloatMenu(menuitem, line, dp, value); } -void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) { - const float value = *(float*)static_cast(menuitem)->value; - onDrawFloatMenu(menuitem, line, 2, value); -} - -void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line) { - const float value = *(float*)static_cast(menuitem)->value; - onDrawFloatMenu(menuitem, line, 3, value); -} - void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked) { onDrawMenuItem(menuitem, line); Draw_Chkb_Line(line, checked); @@ -166,13 +178,15 @@ void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, val); } -void DrawItemEdit() { +void DrawItemEdit(const bool selected) { + const uint16_t bcolor = selected ? HMI_data.Selected_Color : HMI_data.Background_Color; + const uint8_t iNum = 4 - ((MenuData.dp > 0) ? (MenuData.dp - 1) : 0); switch (checkkey) { case SetIntNoDraw: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; case SetInt: - case SetPInt: DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); break; + case SetPInt: DWINUI::Draw_Signed_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); break; case SetFloat: - case SetPFloat: DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, MenuData.dp, VALX - MenuData.dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, MenuData.dp)); break; + case SetPFloat: DWINUI::Draw_Signed_Float(HMI_data.Text_Color, bcolor, iNum, MenuData.dp, VALX - 2 * DWINUI::fontWidth(), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, MenuData.dp)); break; default: break; } } @@ -209,7 +223,7 @@ void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, // Apply: update function when the encoder is pressed void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { SetOnClick(process, lo, hi, 0, val, Apply, LiveUpdate); - Draw_Menu_IntValue(HMI_data.Selected_Color, CurrentMenu->line(), 4, MenuData.Value); + DrawItemEdit(true); } // Generic onclick event for float values @@ -222,7 +236,7 @@ void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const void SetValueOnClick(uint8_t process, const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { const int32_t value = round(val * POW(10, dp)); SetOnClick(process, lo * POW(10, dp), hi * POW(10, dp), dp, value, Apply, LiveUpdate); - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), val); + DrawItemEdit(true); } // Generic onclick event for integer values @@ -271,8 +285,8 @@ void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)( // Generic menu control using the encoder void HMI_Menu() { EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; if (CurrentMenu) { + if (encoder_diffState == ENCODER_DIFF_NO) return; if (encoder_diffState == ENCODER_DIFF_ENTER) CurrentMenu->onClick(); else @@ -280,65 +294,46 @@ void HMI_Menu() { } } -// Get an integer value using the encoder without draw anything -// lo: low limit -// hi: high limit +// Get a value using the encoder +// draw : draw the value // Return value: // 0 : no change // 1 : live change // 2 : apply change -int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) { +int8_t HMI_Get(bool draw) { + const int32_t lo = MenuData.MinValue; + const int32_t hi = MenuData.MaxValue; const int32_t cval = MenuData.Value; - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); - if (encoder_diffState != ENCODER_DIFF_NO) { - if (Apply_Encoder(encoder_diffState, MenuData.Value)) { - EncoderRate.enabled = false; - checkkey = Menu; - return 2; - } - LIMIT(MenuData.Value, lo, hi); - } - return int8_t(cval != MenuData.Value); -} - -// Get an integer value using the encoder -// lo: low limit -// hi: high limit -// Return value: -// 0 : no change -// 1 : live change -// 2 : apply change -int8_t HMI_GetInt(const int32_t lo, const int32_t hi) { - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); + EncoderState encoder_diffState = get_encoder_state(); if (encoder_diffState != ENCODER_DIFF_NO) { if (Apply_Encoder(encoder_diffState, MenuData.Value)) { EncoderRate.enabled = false; - DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Background_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); + if (draw) DrawItemEdit(false); checkkey = Menu; return 2; } LIMIT(MenuData.Value, lo, hi); - DrawItemEdit(); - return 1; } - return 0; + const bool change = cval != MenuData.Value; + if (change) DrawItemEdit(true); + return int8_t(change); } -// Set an integer using the encoder -void HMI_SetInt() { - int8_t val = HMI_GetInt(MenuData.MinValue, MenuData.MaxValue); +// Set and draw a value using the encoder +void HMI_SetDraw() { + int8_t val = HMI_Get(true); switch (val) { - case 0: return; break; + case 0: return; case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; case 2: if (MenuData.Apply) MenuData.Apply(); break; } } -// Set an integer without drawing -void HMI_SetIntNoDraw() { - int8_t val = HMI_GetIntNoDraw(MenuData.MinValue, MenuData.MaxValue); +// Set an value without drawing +void HMI_SetNoDraw() { + int8_t val = HMI_Get(false); switch (val) { - case 0: return; break; + case 0: return; case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; case 2: if (MenuData.Apply) MenuData.Apply(); break; } @@ -346,7 +341,7 @@ void HMI_SetIntNoDraw() { // Set an integer pointer variable using the encoder void HMI_SetPInt() { - int8_t val = HMI_GetInt(MenuData.MinValue, MenuData.MaxValue); + int8_t val = HMI_Get(true); switch (val) { case 0: return; case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; @@ -354,43 +349,9 @@ void HMI_SetPInt() { } } -// Get a scaled float value using the encoder -// dp: decimal places -// lo: scaled low limit -// hi: scaled high limit -// Return value: -// 0 : no change -// 1 : live change -// 2 : apply change -int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) { - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); - if (encoder_diffState != ENCODER_DIFF_NO) { - if (Apply_Encoder(encoder_diffState, MenuData.Value)) { - EncoderRate.enabled = false; - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, dp)); - checkkey = Menu; - return 2; - } - LIMIT(MenuData.Value, lo, hi); - DrawItemEdit(); - return 1; - } - return 0; -} - -// Set a scaled float using the encoder -void HMI_SetFloat() { - const int8_t val = HMI_GetFloat(MenuData.dp, MenuData.MinValue, MenuData.MaxValue); - switch (val) { - case 0: return; - case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; - case 2: if (MenuData.Apply) MenuData.Apply(); break; - } -} - // Set a scaled float pointer variable using the encoder void HMI_SetPFloat() { - const int8_t val = HMI_GetFloat(MenuData.dp, MenuData.MinValue, MenuData.MaxValue); + const int8_t val = HMI_Get(true); switch (val) { case 0: return; case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; @@ -398,7 +359,7 @@ void HMI_SetPFloat() { } } -// Menu Classes =============================================================== +// Menu Class =============================================================== MenuClass::MenuClass() { selected = 0; @@ -407,10 +368,10 @@ MenuClass::MenuClass() { void MenuClass::draw() { MenuTitle.draw(); - if (onMenuDraw != nullptr) onMenuDraw(this); + Draw_Menu(this); for (int8_t i = 0; i < MenuItemCount; i++) MenuItems[i]->draw(i - topline); - if (onCursorDraw != nullptr) onCursorDraw(line()); + Draw_Menu_Cursor(line()); DWIN_UpdateLCD(); } @@ -419,7 +380,7 @@ void MenuClass::onScroll(bool dir) { if (dir) sel++; else sel--; LIMIT(sel, 0, MenuItemCount - 1); if (sel != selected) { - if (onCursorErase != nullptr) onCursorErase(line()); + Erase_Menu_Cursor(line()); DWIN_UpdateLCD(); if ((sel - topline) == TROWS) { DWIN_Frame_AreaMove(1, DWIN_SCROLL_UP, MLINE, DWINUI::backcolor, 0, TITLE_HEIGHT + 1, DWIN_WIDTH, STATUS_Y - 1); @@ -432,7 +393,7 @@ void MenuClass::onScroll(bool dir) { MenuItems[sel]->draw(0); } selected = sel; - if (onCursorDraw != nullptr) onCursorDraw(line()); + Draw_Menu_Cursor(line()); DWIN_UpdateLCD(); } } @@ -441,11 +402,11 @@ void MenuClass::onClick() { if (MenuItems[selected]->onClick != nullptr) (*MenuItems[selected]->onClick)(); } -MenuItemClass *MenuClass::SelectedItem() { +CustomMenuItemClass *MenuClass::SelectedItem() { return MenuItems[selected]; } -MenuItemClass** MenuClass::Items() { +CustomMenuItemClass** MenuClass::Items() { return MenuItems; } @@ -455,40 +416,47 @@ int8_t MenuClass::count() { /* MenuItem Class ===========================================================*/ -MenuItemClass::MenuItemClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) { - icon = cicon; +void CustomMenuItemClass::draw(int8_t line) { + if (line < 0 || line >= TROWS) return; + if (onDraw != nullptr) (*onDraw)(static_cast(this), line); +}; + +void CustomMenuItemClass::redraw(bool erase /*=false*/) { + const int8_t line = CurrentMenu->line(this->pos); + if (erase) Erase_Menu_Text(line); + draw(line); +} + +CustomMenuItemClass::CustomMenuItemClass(OnDrawItem ondraw, OnClickItem onclick) { onClick = onclick; - onDraw = ondraw; - const uint8_t len = _MIN(sizeof(caption) - 1, strlen(text)); - memcpy(&caption[0], text, len); - caption[len] = '\0'; + onDraw = ondraw; } -MenuItemClass::MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) { +MenuItemClass::MenuItemClass(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick) : CustomMenuItemClass(ondraw, onclick) { + icon = cicon; + SetCaption(text); +} + +MenuItemClass::MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw, OnClickItem onclick) : CustomMenuItemClass(ondraw, onclick) { icon = cicon; - onClick = onclick; - onDraw = ondraw; caption[0] = '\0'; frameid = id; frame = { x1, y1, x2, y2 }; } +void MenuItemClass::SetCaption(const char * const text) { + const uint8_t len = _MIN(sizeof(caption) - 1, strlen(text)); + memcpy(&caption[0], text, len); + caption[len] = '\0'; +} + void MenuItemClass::SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) { caption[0] = '\0'; frameid = id; frame = { x1, y1, x2, y2 }; } -void MenuItemClass::draw(int8_t line) { - if (!WITHIN(line, 0, TROWS - 1)) return; - if (onDraw != nullptr) (*onDraw)(this, line); -}; - -void MenuItemClass::redraw() { - draw(CurrentMenu->line(this->pos)); -} - -MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemClass(cicon, text, ondraw, onclick) { +MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val) : MenuItemClass(cicon, text, ondraw, onclick) { value = val; }; @@ -505,40 +473,58 @@ void MenuItemsClear() { void MenuItemsPrepare(int8_t totalitems) { MenuItemsClear(); - MenuItemTotal = totalitems; - MenuItems = new MenuItemClass*[totalitems]; + MenuItemTotal = _MIN(totalitems, MENU_MAX_ITEMS); + MenuItems = new CustomMenuItemClass*[totalitems]; } -MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem) { +bool IsMenu(MenuClass* _menu) { + return ((checkkey == Menu) && !!CurrentMenu && (CurrentMenu == _menu)); +} + +template +T* MenuItemAdd(T* menuitem) { MenuItems[MenuItemCount] = menuitem; menuitem->pos = MenuItemCount++; return menuitem; } -MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text/*=nullptr*/, void (*ondraw)(MenuItemClass* menuitem, int8_t line)/*=nullptr*/, void (*onclick)()/*=nullptr*/) { +CustomMenuItemClass* MenuItemAdd(OnDrawItem ondraw/*=nullptr*/, OnClickItem onclick/*=nullptr*/) { + if (MenuItemCount < MenuItemTotal) { + CustomMenuItemClass* menuitem = new CustomMenuItemClass(ondraw, onclick); + return MenuItemAdd(menuitem); + } + else return nullptr; +} + +MenuItemClass* MenuItemAdd(uint8_t cicon, const char * const text/*=nullptr*/, OnDrawItem ondraw/*=nullptr*/, OnClickItem onclick/*=nullptr*/) { if (MenuItemCount < MenuItemTotal) { MenuItemClass* menuitem = new MenuItemClass(cicon, text, ondraw, onclick); - return MenuItemsAdd(menuitem); + return MenuItemAdd(menuitem); } else return nullptr; } -MenuItemClass* MenuItemsAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)/*=nullptr*/, void (*onclick)()/*=nullptr*/) { +MenuItemClass* MenuItemAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw/*=nullptr*/, OnClickItem onclick/*=nullptr*/) { if (MenuItemCount < MenuItemTotal) { MenuItemClass* menuitem = new MenuItemClass(cicon, id, x1, y1, x2, y2, ondraw, onclick); - return MenuItemsAdd(menuitem); + return MenuItemAdd(menuitem); } else return nullptr; } -MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) { +MenuItemClass* EditItemAdd(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val) { if (MenuItemCount < MenuItemTotal) { MenuItemClass* menuitem = new MenuItemPtrClass(cicon, text, ondraw, onclick, val); - return MenuItemsAdd(menuitem); + return MenuItemAdd(menuitem); } else return nullptr; } +void InitMenu() { + PreviousMenu = nullptr; + InvalidateMenu(); +} + bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems) { if (!menu) menu = new MenuClass(); const bool NotCurrent = (CurrentMenu != menu); @@ -549,6 +535,27 @@ bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems) { return NotCurrent; } +bool SetMenu(MenuClass* &menu, frame_rect_t cn, FSTR_P title, int8_t totalitems) { + if (!menu) menu = new MenuClass(); + const bool NotCurrent = (CurrentMenu != menu); + if (NotCurrent) { + if (cn.w != 0) + menu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h); + else + menu->MenuTitle.SetCaption(title); + MenuItemsPrepare(totalitems); + } + return NotCurrent; +} + +void InvalidateMenu() { + if (CurrentMenu) { + CurrentMenu->topline = 0; + CurrentMenu->selected = 0; + CurrentMenu = nullptr; + } +} + void UpdateMenu(MenuClass* &menu) { if (!menu) return; if (CurrentMenu != menu) { @@ -558,9 +565,9 @@ void UpdateMenu(MenuClass* &menu) { menu->draw(); } -void ReDrawMenu(const bool force/*=false*/) { - if (CurrentMenu && (force || checkkey == Menu)) CurrentMenu->draw(); - if (force) DrawItemEdit(); +void ReDrawMenu(bool force /*= false*/) { + if (CurrentMenu && (force || checkkey==Menu)) CurrentMenu->draw(); + if (force) DrawItemEdit(true); } #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 6a5f8786ca5f9..9bc9d702bd300 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -23,8 +23,8 @@ /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo - * Version: 1.5.1 - * Date: 2022/05/23 + * Version: 1.9.1 + * Date: 2022/12/02 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -44,6 +44,9 @@ #include "dwinui.h" +#define MENU_CHAR_LIMIT 24 +#define MENU_MAX_ITEMS TERN(SDSORT_LIMIT, SDSORT_LIMIT, 64) + typedef struct { int32_t MaxValue = 0; // Auxiliar max integer/scaled float value int32_t MinValue = 0; // Auxiliar min integer/scaled float value @@ -56,46 +59,60 @@ typedef struct { } MenuData_t; extern MenuData_t MenuData; -extern void (*onCursorErase)(const int8_t line); -extern void (*onCursorDraw)(const int8_t line); // Auxiliary Macros =========================================================== // Create and add a MenuItem object to the menu array -#define BACK_ITEM(H) MenuItemsAdd(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, H) -#define MENU_ITEM(V...) MenuItemsAdd(V) -#define EDIT_ITEM(V...) MenuItemsAdd(V) -#define MENU_ITEM_F(I,L,V...) MenuItemsAdd(I, GET_TEXT_F(L), V) -#define EDIT_ITEM_F(I,L,V...) MenuItemsAdd(I, GET_TEXT_F(L), V) +#define SET_MENU(I,L,V) SetMenu(I, GET_TEXT_F(L), V) +#define SET_MENU_F(I,L,V) SetMenu(I, F(L), V) +#define SET_MENU_R(I,R,L,V) SetMenu(I, R, GET_TEXT_F(L), V) + +#define BACK_ITEM(H) MenuItemAdd(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, H) +#define MENU_ITEM(I,L,V...) MenuItemAdd(I, GET_TEXT_F(L), V) +#define EDIT_ITEM(I,L,V...) EditItemAdd(I, GET_TEXT_F(L), V) +#define MENU_ITEM_F(I,L,V...) MenuItemAdd(I, F(L), V) +#define EDIT_ITEM_F(I,L,V...) EditItemAdd(I, F(L), V) // Menu Classes =============================================================== -class MenuItemClass { -protected: +class CustomMenuItemClass; +class MenuItemClass; + +typedef void (*OnDrawCustomItem)(CustomMenuItemClass* menuitem, int8_t line); +typedef void (*OnDrawItem)(MenuItemClass* menuitem, int8_t line); +typedef void (*OnClickItem)(); + +class CustomMenuItemClass { public: int8_t pos = 0; + OnDrawItem onDraw = nullptr; + void (*onClick)() = nullptr; + CustomMenuItemClass() {}; + CustomMenuItemClass(OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr); + virtual ~CustomMenuItemClass(){}; + virtual void draw(int8_t line); + void redraw(bool erase=false); +}; + +class MenuItemClass: public CustomMenuItemClass { +public: uint8_t icon = 0; - char caption[32] = ""; + char caption[MENU_CHAR_LIMIT] = ""; uint8_t frameid = 0; rect_t frame = {0}; - void (*onDraw)(MenuItemClass* menuitem, int8_t line) = nullptr; - void (*onClick)() = nullptr; - MenuItemClass() {}; - MenuItemClass(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); - // MenuItemClass(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) : MenuItemClass(cicon, FTOP(text), ondraw, onclick){} - MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); + using CustomMenuItemClass::CustomMenuItemClass; + MenuItemClass(uint8_t cicon, const char * const text=nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr); + MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr); void SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); - virtual ~MenuItemClass(){}; - virtual void draw(int8_t line); - void redraw(); + void SetCaption(const char * const text = nullptr); }; class MenuItemPtrClass: public MenuItemClass { public: void *value = nullptr; using MenuItemClass::MenuItemClass; - MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val); - MenuItemPtrClass(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemPtrClass(cicon, FTOP(text), ondraw, onclick, val){} + MenuItemPtrClass(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val); + MenuItemPtrClass(uint8_t cicon, FSTR_P text, OnDrawItem ondraw, OnClickItem onclick, void* val) : MenuItemPtrClass(cicon, FTOP(text), ondraw, onclick, val){} }; class MenuClass { @@ -111,12 +128,11 @@ class MenuClass { virtual void draw(); virtual void onScroll(bool dir); void onClick(); - MenuItemClass* SelectedItem(); - static MenuItemClass** Items(); + CustomMenuItemClass* SelectedItem(); + static CustomMenuItemClass** Items(); }; extern MenuClass *CurrentMenu; extern MenuClass *PreviousMenu; -extern void (*onMenuDraw)(MenuClass* menu); // Menuitem Drawing functions ================================================= @@ -124,8 +140,12 @@ void Draw_Title(TitleClass* title); void Draw_Menu(MenuClass* menu); void Draw_Menu_Cursor(const int8_t line); void Erase_Menu_Cursor(const int8_t line); -void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false); +void Erase_Menu_Text(const int8_t line); +void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false, bool selected=false); +void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, FSTR_P label=nullptr, bool more=false, bool selected=false); void Draw_Chkb_Line(const uint8_t line, const bool checked); +void Show_Chkb_Line(const bool checked); +void Toogle_Chkb_Line(bool &checked); void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value=0); void onDrawMenuItem(MenuItemClass* menuitem, int8_t line); void onDrawSubMenu(MenuItemClass* menuitem, int8_t line); @@ -134,9 +154,11 @@ void onDrawPIntMenu(MenuItemClass* menuitem, int8_t line); void onDrawPInt8Menu(MenuItemClass* menuitem, int8_t line); void onDrawPInt32Menu(MenuItemClass* menuitem, int8_t line); void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const float value); -void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line); -void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line); -void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line); +void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp); +inline void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, UNITFDIGITS); }; +inline void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, 2); }; +inline void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, 3); }; +inline void onDrawPFloat4Menu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, 4); }; void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked); void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line); @@ -153,22 +175,28 @@ void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)( // HMI user control functions ================================================= void HMI_Menu(); -void HMI_SetInt(); +void HMI_SetDraw(); +void HMI_SetNoDraw(); void HMI_SetPInt(); -void HMI_SetIntNoDraw(); -void HMI_SetFloat(); void HMI_SetPFloat(); // Menu auxiliary functions =================================================== +// Initialize menu +void InitMenu(); + // Create a new menu bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems); +bool SetMenu(MenuClass* &menu, frame_rect_t cn, FSTR_P title, int8_t totalitems); + +// Invalidate CurrentMenu to prepare for full menu drawing +void InvalidateMenu(); //Update the Menu and Draw if it is valid void UpdateMenu(MenuClass* &menu); //Redraw the current Menu if it is valid -void ReDrawMenu(const bool force=false); +void ReDrawMenu(bool force = false); // Clear MenuItems array and free MenuItems elements void MenuItemsClear(); @@ -176,13 +204,17 @@ void MenuItemsClear(); // Prepare MenuItems array void MenuItemsPrepare(int8_t totalitems); +// Is the current menu = menu? +bool IsMenu(MenuClass* menu); + // Add elements to the MenuItems array -MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); -inline MenuItemClass* MenuItemsAdd(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) { - return MenuItemsAdd(cicon, FTOP(text), ondraw, onclick); +CustomMenuItemClass* MenuItemAdd(OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr); +MenuItemClass* MenuItemAdd(uint8_t cicon, const char * const text=nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr); +inline MenuItemClass* MenuItemAdd(uint8_t cicon, FSTR_P text = nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr) { + return MenuItemAdd(cicon, FTOP(text), ondraw, onclick); } -MenuItemClass* MenuItemsAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); -MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val); -inline MenuItemClass* MenuItemsAdd(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) { - return MenuItemsAdd(cicon, FTOP(text), ondraw, onclick, val); +MenuItemClass* MenuItemAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr); +MenuItemClass* EditItemAdd(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val); +inline MenuItemClass* EditItemAdd(uint8_t cicon, FSTR_P text, OnDrawItem ondraw, OnClickItem onclick, void* val) { + return EditItemAdd(cicon, FTOP(text), ondraw, onclick, val); } diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 2511d33ff1244..18cdffd00d626 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -113,8 +113,8 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) { Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER)); #if USE_UBL_VIEWER DWINUI::ClearMainArea(); - BedLevelTools.viewer_print_value = true; - BedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT); + bedLevelTools.viewer_print_value = true; + bedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT); #else DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); #endif @@ -127,7 +127,7 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) { DWINUI::Draw_Button(BTN_Continue, 86, 305); #if USE_UBL_VIEWER - BedLevelTools.Set_Mesh_Viewer_Status(); + bedLevelTools.Set_Mesh_Viewer_Status(); #else char str_1[6], str_2[6] = ""; ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"), diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index cb1f6c2dda0fb..75917320a45f7 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -23,8 +23,8 @@ /** * DWIN Single var plot * Author: Miguel A. Risco-Castillo - * Version: 2.0 - * Date: 2022/01/31 + * Version: 2.1.2 + * Date: 2022/11/20 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -44,14 +44,9 @@ #include "../../../inc/MarlinConfigPre.h" -#ifdef DWIN_LCD_PROUI - -#include "dwin_defines.h" - -#if HAS_PIDPLOT +#if BOTH(DWIN_LCD_PROUI, HAS_PIDPLOT) #include "plot.h" - #include "../../../core/types.h" #include "../../marlinui.h" #include "dwin_lcd.h" @@ -74,7 +69,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) y2 = frame.y + frame.h - 1; r = round((y2) - ref * scale); DWINUI::Draw_Box(1, Plot_Bg_Color, frame); - for (uint8_t i = 1; i < 4; i++) if (i * 50 < frame.w) DWIN_Draw_VLine(Line_Color, i * 50 + frame.x, frame.y, frame.h); + for (uint8_t i = 1; i < 4; i++) if (i * 50 < frame.w) DWIN_Draw_VLine(Line_Color, i * 50 + frame.x, frame.y, frame.h); DWINUI::Draw_Box(0, Color_White, DWINUI::ExtendFrame(frame, 1)); DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w); } @@ -94,6 +89,4 @@ void PlotClass::Update(const float value) { grphpoints++; } -#endif // HAS_PIDPLOT - -#endif // DWIN_LCD_PROUI +#endif // DWIN_LCD_PROUI && HAS_PIDPLOT diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h index 8522c530bd3fe..ea15255fe53a0 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.h +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -23,8 +23,8 @@ /** * DWIN Single var plot * Author: Miguel A. Risco-Castillo - * Version: 1.0 - * Date: 2022/01/30 + * Version: 2.1.2 + * Date: 2022/11/20 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as diff --git a/Marlin/src/lcd/e3v2/proui/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp index 5a7b6c9c41708..638cd3420809c 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -23,8 +23,8 @@ /** * Print Stats page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.3.0 - * Date: 2022/02/24 + * Version: 1.4.2 + * Date: 2022/12/03 */ #include "../../../inc/MarlinConfigPre.h" @@ -79,4 +79,12 @@ void Goto_PrintStats() { HMI_SaveProcessID(WaitResponse); } +// Print Stats Reset popup +void Popup_ResetStats() { DWIN_Popup_ConfirmCancel(ICON_Info_0, GET_TEXT_F(MSG_RESET_STATS)); } +void OnClick_ResetStats() { + if (HMI_flag.select_flag) PrintStatsClass::Reset(); + HMI_ReturnScreen(); +} +void PrintStatsReset() { Goto_Popup(Popup_ResetStats, OnClick_ResetStats); } + #endif // DWIN_LCD_PROUI && PRINTCOUNTER diff --git a/Marlin/src/lcd/e3v2/proui/printstats.h b/Marlin/src/lcd/e3v2/proui/printstats.h index 705c923da41bf..4a383068864b1 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.h +++ b/Marlin/src/lcd/e3v2/proui/printstats.h @@ -24,8 +24,8 @@ /** * Print Stats page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.3.0 - * Date: 2022/02/24 + * Version: 1.4.2 + * Date: 2022/12/03 */ class PrintStatsClass { @@ -37,3 +37,4 @@ class PrintStatsClass { extern PrintStatsClass PrintStats; void Goto_PrintStats(); +void PrintStatsReset(); diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/DGUSDisplayDef.h index 9cbcf0dd7b126..8403e29e56449 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplayDef.h @@ -46,12 +46,12 @@ extern const struct DGUS_VP_Variable ListOfVP[]; #include "../../../inc/MarlinConfig.h" -#if ENABLED(DGUS_LCD_UI_ORIGIN) +#if DGUS_LCD_UI_ORIGIN #include "origin/DGUSDisplayDef.h" -#elif ENABLED(DGUS_LCD_UI_MKS) +#elif DGUS_LCD_UI_MKS #include "mks/DGUSDisplayDef.h" -#elif ENABLED(DGUS_LCD_UI_FYSETC) +#elif DGUS_LCD_UI_FYSETC #include "fysetc/DGUSDisplayDef.h" -#elif ENABLED(DGUS_LCD_UI_HIPRECY) +#elif DGUS_LCD_UI_HIPRECY #include "hiprecy/DGUSDisplayDef.h" #endif diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h index 575a71d2892f3..4486105d3c4a0 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h @@ -46,13 +46,13 @@ #define BE16_P(V) ( ((uint8_t*)(V))[0] << 8U | ((uint8_t*)(V))[1] ) #define BE32_P(V) ( ((uint8_t*)(V))[0] << 24U | ((uint8_t*)(V))[1] << 16U | ((uint8_t*)(V))[2] << 8U | ((uint8_t*)(V))[3] ) -#if ENABLED(DGUS_LCD_UI_ORIGIN) +#if DGUS_LCD_UI_ORIGIN #include "origin/DGUSScreenHandler.h" -#elif ENABLED(DGUS_LCD_UI_MKS) +#elif DGUS_LCD_UI_MKS #include "mks/DGUSScreenHandler.h" -#elif ENABLED(DGUS_LCD_UI_FYSETC) +#elif DGUS_LCD_UI_FYSETC #include "fysetc/DGUSScreenHandler.h" -#elif ENABLED(DGUS_LCD_UI_HIPRECY) +#elif DGUS_LCD_UI_HIPRECY #include "hiprecy/DGUSScreenHandler.h" #endif diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp index 0e825c9e7c336..3e731de438cb8 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp @@ -24,7 +24,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_FYSETC) +#if DGUS_LCD_UI_FYSETC #include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index 1f72c685fb81c..b68f72a1fb511 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_FYSETC) +#if DGUS_LCD_UI_FYSETC #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp index 6e4c76ca68df3..a348a1f9a11c3 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp @@ -24,7 +24,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_HIPRECY) +#if DGUS_LCD_UI_HIPRECY #include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index f04bef2fd8dae..475a03307eeb5 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_HIPRECY) +#if DGUS_LCD_UI_HIPRECY #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp index ae8d9565e3f57..40f6a349d5863 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_MKS) +#if DGUS_LCD_UI_MKS #include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 36ab016b35a68..882cfadcd2ac5 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_MKS) +#if DGUS_LCD_UI_MKS #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp index 0115d3b8c13b4..004b453e6e2b4 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp @@ -26,7 +26,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_ORIGIN) +#if DGUS_LCD_UI_ORIGIN #include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index aaa8b72e11822..55be3777e1083 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_ORIGIN) +#if DGUS_LCD_UI_ORIGIN #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp index 15b3f5adcde4d..df22407c0f41e 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp @@ -24,7 +24,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUSDisplay.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index ce03ab6b8340e..2b750df9c9cad 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUSRxHandler.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 0b584fac3bcee..4d758ae5ef741 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp index 090d53c92e77c..4caccc0717684 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUSSetupHandler.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index 1837a0c93ab27..47603052e966e 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUSTxHandler.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp index 1627d44c84662..855c0bccfa133 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUS_ScreenAddrList.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp index 13319edd0595c..a9f13b5ee54c7 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUS_ScreenSetup.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp index e77aa4501165a..faa6a0d23556d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp @@ -22,7 +22,7 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "DGUS_VPList.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index f6f2c0f89df9f..1ff22da2687bb 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -26,7 +26,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_RELOADED) +#if DGUS_LCD_UI_RELOADED #include "../ui_api.h" #include "DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp index e3b95c4cd4904..656c1f04d2eaa 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp @@ -52,7 +52,6 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .enabled(ENABLED(HAS_MULTI_HOTEND)) .tag(6) .button(BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) - .tag(7) .button(BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) .tag(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MAX_SPEED)) .tag(9) .button(BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) diff --git a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp index 7a191e906ac66..cdde3c4f6b51f 100644 --- a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp +++ b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_IA_CREALITY) +#if DGUS_LCD_UI_IA_CREALITY #include "FileNavigator.h" diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp index 4aa7bd8dcdf4a..d9e3cb587703f 100644 --- a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp +++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp @@ -32,7 +32,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DGUS_LCD_UI_IA_CREALITY) +#if DGUS_LCD_UI_IA_CREALITY #include "creality_extui.h" #include "FileNavigator.h" @@ -85,27 +85,22 @@ namespace ExtUI { uint16_t pid_bedAutoTemp = 70; #endif + #ifndef CUSTOM_MACHINE_NAME + #define CUSTOM_MACHINE_NAME MACHINE_NAME + #endif + void onStartup() { DWIN_SERIAL.begin(115200); rtscheck.recdat.head[0] = rtscheck.snddat.head[0] = FHONE; rtscheck.recdat.head[1] = rtscheck.snddat.head[1] = FHTWO; memset(rtscheck.databuf, 0, sizeof(rtscheck.databuf)); - #if ENABLED(DWINOS_4) - #define DWIN_BOOTUP_DELAY 1500 - #else - #define DWIN_BOOTUP_DELAY 500 - #endif - delay_ms(DWIN_BOOTUP_DELAY); // Delay to allow screen startup + delay_ms(TERN(DWINOS_4, 1500, 500)); // Delay to allow screen startup SetTouchScreenConfiguration(); rtscheck.RTS_SndData(StartSoundSet, SoundAddr); delay_ms(400); // Delay to allow screen to configure - #if defined(CUSTOM_MACHINE_NAME) - onStatusChanged(CUSTOM_MACHINE_NAME " Ready"); - #else - onStatusChanged(MACHINE_NAME " Ready"); - #endif + onStatusChanged(CUSTOM_MACHINE_NAME " Ready"); rtscheck.RTS_SndData(100, FeedrateDisplay); @@ -116,11 +111,7 @@ namespace ExtUI { rtscheck.RTS_SndData(0, NozzlePreheat); rtscheck.RTS_SndData(0, BedPreheat); rtscheck.RTS_SndData(getActualTemp_celsius(H0), NozzleTemp); - #if HAS_MULTI_HOTEND - rtscheck.RTS_SndData(getActualTemp_celsius(H1), e2Temp); - #else - rtscheck.RTS_SndData(0, e2Temp); - #endif + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getActualTemp_celsius(H1)), e2Temp); rtscheck.RTS_SndData(getActualTemp_celsius(BED), Bedtemp); /***************transmit Fan speed to screen*****************/ rtscheck.RTS_SndData(getActualFan_percent((fan_t)getActiveTool()), FanKeyIcon); @@ -130,11 +121,7 @@ namespace ExtUI { rtscheck.RTS_SndData(0, MacVersion + j); char sizebuf[20] = {0}; sprintf(sizebuf, "%d X %d X %d", Y_BED_SIZE, X_BED_SIZE, Z_MAX_POS); - #if defined(CUSTOM_MACHINE_NAME) - rtscheck.RTS_SndData(CUSTOM_MACHINE_NAME, MacVersion); - #else - rtscheck.RTS_SndData(MACHINE_NAME, MacVersion); - #endif + rtscheck.RTS_SndData(CUSTOM_MACHINE_NAME, MacVersion); rtscheck.RTS_SndData(SHORT_BUILD_VERSION, SoftVersion); rtscheck.RTS_SndData(sizebuf, PrinterSize); rtscheck.RTS_SndData(WEBSITE_URL, CorpWebsite); @@ -170,23 +157,16 @@ namespace ExtUI { } reEntryCount = 0; - if (idleThrottling++ < 750) - return; + if (idleThrottling++ < 750) return; // Always send temperature data rtscheck.RTS_SndData(getActualTemp_celsius(getActiveTool()), NozzleTemp); rtscheck.RTS_SndData(getActualTemp_celsius(BED), Bedtemp); rtscheck.RTS_SndData(getTargetTemp_celsius(getActiveTool()), NozzlePreheat); rtscheck.RTS_SndData(getTargetTemp_celsius(BED), BedPreheat); - #if HAS_MULTI_HOTEND - rtscheck.RTS_SndData(getActualTemp_celsius(H1), e2Temp); - rtscheck.RTS_SndData(getTargetTemp_celsius(H1), e2Preheat); - - rtscheck.RTS_SndData(((uint8_t)getActiveTool() + 1), ActiveToolVP); - #else - rtscheck.RTS_SndData(0, e2Temp); - rtscheck.RTS_SndData(0, e2Preheat); - #endif + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getActualTemp_celsius(H1)), e2Temp); + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getTargetTemp_celsius(H1)), e2Preheat); + TERN_(HAS_MULTI_HOTEND, rtscheck.RTS_SndData(uint8_t(getActiveTool() + 1), ActiveToolVP)); if (awaitingUserConfirm() && (lastPauseMsgState != ExtUI::pauseModeStatus || userConfValidation > 99)) { switch (ExtUI::pauseModeStatus) { @@ -196,12 +176,7 @@ namespace ExtUI { case PAUSE_MESSAGE_WAITING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; case PAUSE_MESSAGE_INSERT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; case PAUSE_MESSAGE_LOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE)); break; - #else - ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); break; - #endif + case PAUSE_MESSAGE_PURGE: ExtUI::onUserConfirmRequired(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; case PAUSE_MESSAGE_RESUME: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; @@ -210,19 +185,19 @@ namespace ExtUI { default: onUserConfirmRequired(PSTR("Confirm Continue")); break; } userConfValidation = 0; - } else if (pause_resume_selected && !awaitingUserConfirm()) { rtscheck.RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); pause_resume_selected = false; userConfValidation = 0; } - else if (awaitingUserConfirm() && !pause_resume_selected) { - userConfValidation++; - } - else if (awaitingUserConfirm() && pause_resume_selected) { - pause_resume_selected = false; - userConfValidation = 100; + else if (awaitingUserConfirm()) { + if (pause_resume_selected) { + pause_resume_selected = false; + userConfValidation = 100; + } + else + userConfValidation++; } reEntryPrevent = true; @@ -248,17 +223,16 @@ namespace ExtUI { break; case 2: - if (isPositionKnown() && !commandsInQueue()) - waitway = 0; + if (isPositionKnown() && !commandsInQueue()) waitway = 0; break; case 3: DEBUG_ECHOLNPGM("==waitway 3=="); - // if(isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED)-1))) { + //if(isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED)-1))) { rtscheck.RTS_SndData(ExchangePageBase + 64, ExchangepageAddr); waitway = 7; - // return; - // } + //return; + //} break; case 4: @@ -266,58 +240,32 @@ namespace ExtUI { DEBUG_ECHOLNPGM("==waitway 4=="); // rtscheck.RTS_SndData(ExchangePageBase + 71 + AxisPagenum, ExchangepageAddr); AutohomeKey = false; - waitway = 0; + waitway = 0; } break; case 5: if (isPositionKnown() && !commandsInQueue()) { InforShowStatus = true; - waitway = 0; + waitway = 0; DEBUG_ECHOLNPGM("==waitway 5=="); rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); // exchange to 78 page } break; case 6: if (!commandsInQueue()) { - setAxisPosition_mm(BED_TRAMMING_HEIGHT, (axis_t)Z); + setAxisPosition_mm(BED_TRAMMING_HEIGHT, axis_t(Z)); waitway = 0; } break; case 7: - if (!commandsInQueue()) - waitway = 0; + if (!commandsInQueue()) waitway = 0; break; } - void yield(); - - #if HAS_MESH - if (getLevelingActive()) - rtscheck.RTS_SndData(3, AutoLevelIcon); /*On*/ - else - rtscheck.RTS_SndData(2, AutoLevelIcon); /*Off*/ - #endif - - #if HAS_FILAMENT_SENSOR - if (getFilamentRunoutEnabled()) - rtscheck.RTS_SndData(3, RunoutToggle); /*On*/ - else - rtscheck.RTS_SndData(2, RunoutToggle); /*Off*/ - #endif - - #if ENABLED(CASE_LIGHT_ENABLE) - if (getCaseLightState()) - rtscheck.RTS_SndData(3, LedToggle); /*On*/ - else - rtscheck.RTS_SndData(2, LedToggle); /*Off*/ - #endif - - #if ENABLED(POWER_LOSS_RECOVERY) - if (getPowerLossRecoveryEnabled()) - rtscheck.RTS_SndData(3, PowerLossToggle); /*On*/ - else - rtscheck.RTS_SndData(2, PowerLossToggle); /*Off*/ - #endif + TERN_(HAS_MESH, rtscheck.RTS_SndData(getLevelingActive() ? 3 : 2, AutoLevelIcon)); + TERN_(HAS_FILAMENT_SENSOR, rtscheck.RTS_SndData(getFilamentRunoutEnabled() ? 3 : 2, RunoutToggle)); + TERN_(CASE_LIGHT_ENABLE, rtscheck.RTS_SndData(getCaseLightState() ? 3 : 2, LedToggle)); + TERN_(POWER_LOSS_RECOVERY, rtscheck.RTS_SndData(getPowerLossRecoveryEnabled() ? 3 : 2, PowerLossToggle)); if (startprogress == 0) { startprogress += 25; @@ -339,7 +287,7 @@ namespace ExtUI { if (startprogress <= 100) rtscheck.RTS_SndData(startprogress, StartIcon); else - rtscheck.RTS_SndData((startprogress - 100), StartIcon + 1); + rtscheck.RTS_SndData(startprogress - 100, StartIcon + 1); // rtscheck.RTS_SndData((startprogress++) % 5, ExchFlmntIcon); @@ -427,8 +375,7 @@ namespace ExtUI { unsigned int IconTemp; IconTemp = getActualTemp_celsius(getActiveTool()) * 100 / getTargetTemp_celsius(getActiveTool()); - if (IconTemp >= 100) - IconTemp = 100; + NOMORE(IconTemp, 100); rtscheck.RTS_SndData(IconTemp, HeatPercentIcon); if (getActualTemp_celsius(getActiveTool()) > EXTRUDE_MINTEMP && NozzleTempStatus[0] != 0) { NozzleTempStatus[0] = 0; @@ -455,17 +402,9 @@ namespace ExtUI { } if (isMediaInserted()) { - uint16_t currPage, maxPageAdd; - if (fileIndex == 0) - currPage = 1; - else - currPage = CEIL((float)((float)fileIndex / (float)DISPLAY_FILES)) + 1; - - if (filenavigator.folderdepth != 0) - maxPageAdd = 1; - else - maxPageAdd = 0; - uint16_t maxPages = CEIL((float)(filenavigator.maxFiles() + maxPageAdd) / (float)DISPLAY_FILES ); + const uint16_t currPage = fileIndex == 0 ? 1 : CEIL(float(fileIndex) / float(DISPLAY_FILES)) + 1, + maxPageAdd = filenavigator.folderdepth ? 1 : 0, + maxPages = CEIL(float(filenavigator.maxFiles() + maxPageAdd) / float(DISPLAY_FILES) ); rtscheck.RTS_SndData(currPage, FilesCurentPage); rtscheck.RTS_SndData(maxPages, FilesMaxPage); @@ -475,17 +414,14 @@ namespace ExtUI { rtscheck.RTS_SndData(0, FilesMaxPage); } - void yield(); - if (rtscheck.recdat.addr != DisplayZaxis && rtscheck.recdat.addr != DisplayYaxis && rtscheck.recdat.addr != DisplayZaxis) { - rtscheck.RTS_SndData(10 * getAxisPosition_mm((axis_t)X), DisplayXaxis); - rtscheck.RTS_SndData(10 * getAxisPosition_mm((axis_t)Y), DisplayYaxis); - rtscheck.RTS_SndData(10 * getAxisPosition_mm((axis_t)Z), DisplayZaxis); + rtscheck.RTS_SndData(10 * getAxisPosition_mm(axis_t(X)), DisplayXaxis); + rtscheck.RTS_SndData(10 * getAxisPosition_mm(axis_t(Y)), DisplayYaxis); + rtscheck.RTS_SndData(10 * getAxisPosition_mm(axis_t(Z)), DisplayZaxis); } reEntryPrevent = false; } - rx_datagram_state_t RTSSHOW::rx_datagram_state = DGUS_IDLE; uint8_t RTSSHOW::rx_datagram_len = 0; bool RTSSHOW::Initialized = false; @@ -619,14 +555,13 @@ namespace ExtUI { } void RTSSHOW::RTS_SndData(const String &s, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { - if (s.length() < 1) - return; + if (s.length() < 1) return; RTS_SndData(s.c_str(), addr, cmd); } void RTSSHOW::RTS_SndData(const char *str, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { - int len = strlen(str); + int len = strlen(str); constexpr int maxlen = SizeofDatabuf - 6; if (len > 0) { if (len > maxlen) len = maxlen; @@ -724,8 +659,7 @@ namespace ExtUI { recdat.head[1] = FHTWO; return; } - DEBUG_ECHOLNPGM("recdat.data[0] ==", recdat.data[0]); - DEBUG_ECHOLNPGM("recdat.addr ==", recdat.addr); + DEBUG_ECHOLNPGM("recdat.data[0] ==", recdat.data[0], " recdat.addr ==", recdat.addr); for (int i = 0; Addrbuf[i] != 0; i++) if (recdat.addr == Addrbuf[i]) { if (Addrbuf[i] == NzBdSet || Addrbuf[i] == NozzlePreheat || Addrbuf[i] == BedPreheat || Addrbuf[i] == Flowrate) @@ -742,64 +676,34 @@ namespace ExtUI { } switch (recdat.addr) { - case ProbeOffset_Z: { - Checkkey = Zoffset_Value; - break; - } case Flowrate: - case StepMM_X: - case StepMM_Y: - case StepMM_Z: - case StepMM_E: - case ProbeOffset_X: - case ProbeOffset_Y: - case HotendPID_AutoTmp: - case BedPID_AutoTmp: - case HotendPID_P: - case HotendPID_I: - case HotendPID_D: - case BedPID_P: - case BedPID_I: - case BedPID_D: - case T2Offset_X: - case T2Offset_Y: - case T2Offset_Z: - case T2StepMM_E: - case Accel_X: - case Accel_Y: - case Accel_Z: - case Accel_E: - case Feed_X: - case Feed_Y: - case Feed_Z: - case Feed_E: - case Jerk_X: - case Jerk_Y: - case Jerk_Z: - case Jerk_E: + case StepMM_X ... StepMM_E: + case ProbeOffset_X ... ProbeOffset_Y: + case HotendPID_AutoTmp ... BedPID_AutoTmp: + case HotendPID_P ... HotendPID_D: + case BedPID_P ... BedPID_D: + case T2Offset_X ... T2StepMM_E: + case Accel_X ... Accel_E: + case Feed_X ... Feed_E: + case Jerk_X ... Jerk_E: case RunoutToggle: case PowerLossToggle: case FanKeyIcon: - case LedToggle: - case e2Preheat: - Checkkey = ManualSetTemp; + case LedToggle: break; + case e2Preheat: Checkkey = ManualSetTemp; break; + case ProbeOffset_Z: Checkkey = Zoffset_Value; break; + case VolumeDisplay: Checkkey = VolumeDisplay; break; + case DisplayBrightness: Checkkey = DisplayBrightness; break; + case DisplayStandbyBrightness: Checkkey = DisplayStandbyBrightness; break; + case DisplayStandbySeconds: Checkkey = DisplayStandbySeconds; break; + default: + if (WITHIN(recdat.addr, AutolevelVal, 4400)) // ((int)AutolevelVal+(GRID_MAX_POINTS_X*GRID_MAX_POINTS_Y*2)) = 4400 with 5x5 mesh + Checkkey = AutolevelVal; + else if (WITHIN(recdat.addr, SDFILE_ADDR, SDFILE_ADDR + 10 * (FileNum + 1))) + Checkkey = Filename; break; } - if (recdat.addr == VolumeDisplay) - Checkkey = VolumeDisplay; - if (recdat.addr == DisplayBrightness) - Checkkey = DisplayBrightness; - if (recdat.addr == DisplayStandbyBrightness) - Checkkey = DisplayStandbyBrightness; - if (recdat.addr == DisplayStandbySeconds) - Checkkey = DisplayStandbySeconds; - if (recdat.addr >= AutolevelVal && recdat.addr <= 4400)// ((int)AutolevelVal+(GRID_MAX_POINTS_X*GRID_MAX_POINTS_Y*2)) = 4400 with 5x5 mesh - Checkkey = AutolevelVal; - - if (recdat.addr >= SDFILE_ADDR && recdat.addr <= (SDFILE_ADDR + 10 * (FileNum + 1))) - Checkkey = Filename; - DEBUG_ECHOLNPGM("== Checkkey=="); DEBUG_ECHOLN(Checkkey); @@ -862,19 +766,14 @@ namespace ExtUI { DEBUG_ECHOLNPGM("Handle Data Adjust 2 Setting Screen "); InforShowStatus = true; if (PrinterStatusKey[1] == 3) // during heating - RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); else if (PrinterStatusKey[1] == 4) RTS_SndData(ExchangePageBase + 54, ExchangepageAddr); else RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); } - else if (recdat.data[0] == 3) { - if (getTargetFan_percent((fan_t)getActiveTool()) != 0) // turn on the fan - setTargetFan_percent(100, FAN0); - else // turn off the fan - setTargetFan_percent(0, FAN0); - } + else if (recdat.data[0] == 3) + setTargetFan_percent(getTargetFan_percent((fan_t)getActiveTool()) != 0 ? 100 : 0, FAN0); break; @@ -929,12 +828,12 @@ namespace ExtUI { tmp_zprobe_offset = ((float)recdat.data[0]) / 100; DEBUG_ECHOLNPGM("Requested Offset ", tmp_zprobe_offset); if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, (axis_t)Z); + int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); if (tmpSteps == 0) { DEBUG_ECHOLNPGM("Rounding to step"); tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; } - smartAdjustAxis_steps(tmpSteps * -1, (axis_t)Z, false); + smartAdjustAxis_steps(tmpSteps * -1, axis_t(Z), false); char zOffs[20], tmp1[11]; sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); onStatusChanged(zOffs); @@ -974,14 +873,12 @@ namespace ExtUI { else if (recdat.data[0] == 5) { // PLA mode setTargetTemp_celsius(PREHEAT_1_TEMP_HOTEND, getActiveTool()); setTargetTemp_celsius(PREHEAT_1_TEMP_BED, BED); - RTS_SndData(PREHEAT_1_TEMP_HOTEND, NozzlePreheat); RTS_SndData(PREHEAT_1_TEMP_BED, BedPreheat); } else if (recdat.data[0] == 6) { // ABS mode setTargetTemp_celsius(PREHEAT_2_TEMP_HOTEND, getActiveTool()); setTargetTemp_celsius(PREHEAT_2_TEMP_BED, BED); - RTS_SndData(PREHEAT_2_TEMP_HOTEND, NozzlePreheat); RTS_SndData(PREHEAT_2_TEMP_BED, BedPreheat); } @@ -993,12 +890,8 @@ namespace ExtUI { setTargetTemp_celsius(0.0, H0); TERN_(HAS_MULTI_HOTEND, setTargetTemp_celsius(0.0, H1)); setTargetTemp_celsius(0.0, BED); - - RTS_SndData(0, NozzlePreheat); - delay_ms(1); - RTS_SndData(0, BedPreheat); - delay_ms(1); - + RTS_SndData(0, NozzlePreheat); delay_ms(1); + RTS_SndData(0, BedPreheat); delay_ms(1); RTS_SndData(ExchangePageBase + 57, ExchangepageAddr); PrinterStatusKey[1] = 2; } @@ -1036,6 +929,7 @@ namespace ExtUI { else if (recdat.addr == Flowrate) { setFlow_percent((int16_t)recdat.data[0], getActiveTool()); } + #if HAS_PID_HEATING else if (recdat.addr == HotendPID_AutoTmp) { pid_hotendAutoTemp = (uint16_t)recdat.data[0]; @@ -1140,28 +1034,19 @@ namespace ExtUI { #if HAS_FILAMENT_SENSOR else if (recdat.addr == RunoutToggle) { - if (getFilamentRunoutEnabled()) - setFilamentRunoutEnabled(false); - else - setFilamentRunoutEnabled(true); + setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); } #endif #if ENABLED(POWER_LOSS_RECOVERY) else if (recdat.addr == PowerLossToggle) { - if (getPowerLossRecoveryEnabled()) - setPowerLossRecoveryEnabled(false); - else - setPowerLossRecoveryEnabled(true); + setPowerLossRecoveryEnabled(!getPowerLossRecoveryEnabled()); } #endif #if ENABLED(CASE_LIGHT_ENABLE) else if (recdat.addr == LedToggle) { - if (getCaseLightState()) - setCaseLightState(false); - else - setCaseLightState(true); + setCaseLightState(!getCaseLightState()); } #endif @@ -1197,20 +1082,15 @@ namespace ExtUI { } else if (recdat.data[0] == 1) { // Bed Autoleveling #if HAS_MESH - if (getLevelingActive()) - RTS_SndData(3, AutoLevelIcon); - else - RTS_SndData(2, AutoLevelIcon); + RTS_SndData(getLevelingActive() ? 3 : 2, AutoLevelIcon); if (ExtUI::getMeshValid()) { uint8_t abl_probe_index = 0; for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { - uint8_t x_Point = inner; - bool zig = (outer & 1); - if (zig) x_Point = (GRID_MAX_POINTS_X - 1) - inner; - xy_uint8_t point = {x_Point, outer}; - rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); + const bool zig = outer & 1; + const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; + rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + abl_probe_index * 2); ++abl_probe_index; } } @@ -1229,13 +1109,8 @@ namespace ExtUI { RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2); RTS_SndData(getActualTemp_celsius(H0), NozzleTemp); RTS_SndData(getTargetTemp_celsius(H0), NozzlePreheat); - #if HAS_MULTI_HOTEND - rtscheck.RTS_SndData(getActualTemp_celsius(H1), e2Temp); - rtscheck.RTS_SndData(getTargetTemp_celsius(H1), e2Preheat); - #else - rtscheck.RTS_SndData(0, e2Temp); - rtscheck.RTS_SndData(0, e2Preheat); - #endif + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getActualTemp_celsius(H1)), e2Temp); + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getTargetTemp_celsius(H1)), e2Preheat); delay_ms(2); RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); } @@ -1270,17 +1145,13 @@ namespace ExtUI { switch (recdat.data[0]) { case 1: { // Z-axis to home // Disallow Z homing if X or Y are unknown - if (!isAxisPositionKnown((axis_t)X) || !isAxisPositionKnown((axis_t)Y)) - injectCommands(F("G28\nG1F1500Z0.0")); - else - injectCommands(F("G28Z\nG1F1500Z0.0")); - + injectCommands(isAxisPositionKnown(axis_t(X)) && isAxisPositionKnown(axis_t(Y)) ? F("G28Z\nG1F1500Z0.0") : F("G28\nG1F1500Z0.0")); RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); break; } case 2: { // Z-axis to Up if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - smartAdjustAxis_steps((getAxisSteps_per_mm(Z) / 10), (axis_t)Z, false); + smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //DEBUG_ECHOLNPGM("Babystep Pos Steps : ", (int)(getAxisSteps_per_mm(Z) / 10)); //setZOffset_mm(getZOffset_mm() + 0.1); RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); @@ -1292,9 +1163,9 @@ namespace ExtUI { } case 3: { // Z-axis to Down if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - smartAdjustAxis_steps(((getAxisSteps_per_mm(Z) / 10) * -1), (axis_t)Z, false); + smartAdjustAxis_steps(((getAxisSteps_per_mm(Z) / 10) * -1), axis_t(Z), false); // DEBUG_ECHOLNPGM("Babystep Neg Steps : ", (int)((getAxisSteps_per_mm(Z) / 10) * -1)); - // babystepAxis_steps((((int)getAxisSteps_per_mm(Z) / 10) * -1), (axis_t)Z); + // babystepAxis_steps((((int)getAxisSteps_per_mm(Z) / 10) * -1), axis_t(Z)); // setZOffset_mm(getZOffset_mm() - 0.1); RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); char zOffs[20], tmp1[11]; @@ -1328,50 +1199,45 @@ namespace ExtUI { } case 6: { // Assitant Level , Centre 1 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, (axis_t)Z); - setAxisPosition_mm(X_CENTER, (axis_t)X); - setAxisPosition_mm(Y_CENTER, (axis_t)Y); + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_CENTER, axis_t(X)); + setAxisPosition_mm(Y_CENTER, axis_t(Y)); waitway = 6; break; } case 7: { // Assitant Level , Front Left 2 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, (axis_t)Z); - setAxisPosition_mm((X_MIN_BED + lfrb[0]), (axis_t)X); - setAxisPosition_mm((Y_MIN_BED + lfrb[1]), (axis_t)Y); + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); + setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); waitway = 6; break; } case 8: { // Assitant Level , Front Right 3 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, (axis_t)Z); - setAxisPosition_mm((X_MAX_BED - lfrb[2]), (axis_t)X); - setAxisPosition_mm((Y_MIN_BED + lfrb[1]), (axis_t)Y); + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); + setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); waitway = 6; break; } case 9: { // Assitant Level , Back Right 4 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, (axis_t)Z); - setAxisPosition_mm((X_MAX_BED - lfrb[2]), (axis_t)X); - setAxisPosition_mm((Y_MAX_BED - lfrb[3]), (axis_t)Y); + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); + setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); waitway = 6; break; } case 10: { // Assitant Level , Back Left 5 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, (axis_t)Z); - setAxisPosition_mm((X_MIN_BED + lfrb[0]), (axis_t)X); - setAxisPosition_mm((Y_MAX_BED - lfrb[3]), (axis_t)Y); + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); + setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); waitway = 6; break; } case 11: { // Autolevel switch #if HAS_MESH - if (!getLevelingActive()) { // turn on the Autolevel - RTS_SndData(3, AutoLevelIcon); - setLevelingActive(true); - } - else { // turn off the Autolevel - RTS_SndData(2, AutoLevelIcon); - setLevelingActive(false); - } + const bool gla = !getLevelingActive(); + setLevelingActive(gla); + RTS_SndData(gla ? 3 : 2, AutoLevelIcon); #endif RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); break; @@ -1538,19 +1404,13 @@ namespace ExtUI { setTargetTemp_celsius((PREHEAT_1_TEMP_HOTEND + 10), getActiveTool()); IconTemp = getActualTemp_celsius(getActiveTool()) * 100 / getTargetTemp_celsius(getActiveTool()); - if (IconTemp >= 100) - IconTemp = 100; + NOMORE(IconTemp, 100); RTS_SndData(IconTemp, HeatPercentIcon); RTS_SndData(getActualTemp_celsius(H0), NozzleTemp); RTS_SndData(getTargetTemp_celsius(H0), NozzlePreheat); - #if HAS_MULTI_HOTEND - rtscheck.RTS_SndData(getActualTemp_celsius(H1), e2Temp); - rtscheck.RTS_SndData(getTargetTemp_celsius(H1), e2Preheat); - #else - rtscheck.RTS_SndData(0, e2Temp); - rtscheck.RTS_SndData(0, e2Preheat); - #endif + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getActualTemp_celsius(H1)), e2Temp); + rtscheck.RTS_SndData(TERN0(HAS_MULTI_HOTEND, getTargetTemp_celsius(H1)), e2Preheat); delay_ms(5); RTS_SndData(ExchangePageBase + 68, ExchangepageAddr); break; @@ -1652,24 +1512,27 @@ namespace ExtUI { // PrinterStatusKey[1] = 3; // pause_resume_selected = true; } - else if (ExtUI::pauseModeStatus == PAUSE_MESSAGE_PURGE || ExtUI::pauseModeStatus == PAUSE_MESSAGE_OPTION) { + else { #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (getFilamentRunoutState() && getFilamentRunoutEnabled(getActiveTool())) { - ExtUI::setFilamentRunoutEnabled(false, getActiveTool()); - } - else { - setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT); - setUserConfirmed(); - PrinterStatusKey[1] = 3; - pause_resume_selected = true; + bool runouton = false; + if (getFilamentRunoutState()) { + #if NUM_RUNOUT_SENSORS > 1 + if ((runouton = getFilamentRunoutEnabled(getActiveTool()))) + ExtUI::setFilamentRunoutEnabled(false, getActiveTool()); + #else + if ((runouton = getFilamentRunoutEnabled())) + ExtUI::setFilamentRunoutEnabled(false); + #endif } - #else + constexpr bool runouton = false; + #endif + if (!runouton) { setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT); setUserConfirmed(); - PrinterStatusKey[1] = 3; + PrinterStatusKey[1] = 3; pause_resume_selected = true; - #endif + } } } else if (recdat.data[0] == 0) { // Filamet is out, Cancel Selected @@ -1681,14 +1544,15 @@ namespace ExtUI { } break; - #if ENABLED(POWER_LOSS_RECOVERY) - case PwrOffNoF: - if (recdat.data[0] == 1) // Yes:continue to print the 3Dmode during power-off. - injectCommands(F("M1000")); - else if (recdat.data[0] == 2) // No - injectCommands(F("M1000C")); - break; - #endif + #if ENABLED(POWER_LOSS_RECOVERY) + case PwrOffNoF: + if (recdat.data[0] == 1) // Yes: continue to print the 3Dmode during power-off. + injectCommands(F("M1000")); + else if (recdat.data[0] == 2) // No + injectCommands(F("M1000C")); + break; + #endif + case Volume: if (recdat.data[0] < 0) Settings.display_volume = 0; @@ -1852,31 +1716,22 @@ namespace ExtUI { break; } - case AutolevelVal: - { - uint8_t meshPoint = (recdat.addr - AutolevelVal) / 2; - uint8_t yPnt = floor(meshPoint / GRID_MAX_POINTS_X); - uint8_t xPnt; - if (yPnt % 2 == 0) - xPnt = meshPoint - (yPnt * GRID_MAX_POINTS_X); - else - xPnt = (GRID_MAX_POINTS_X - 1) - (meshPoint - (yPnt * GRID_MAX_POINTS_X)); // zag row - float meshVal; - DEBUG_ECHOLNPGM("meshPoint ", meshPoint); - DEBUG_ECHOLNPGM("xPnt ", xPnt); - DEBUG_ECHOLNPGM("yPnt ", yPnt); + case AutolevelVal: { + uint8_t meshPoint = (recdat.addr - AutolevelVal) / 2, + yPnt = floor(meshPoint / GRID_MAX_POINTS_X), + xPnt = meshPoint - (yPnt * GRID_MAX_POINTS_X); + if (yPnt % 2 != 0) xPnt = (GRID_MAX_POINTS_X - 1) - xPnt; // zag row - if (recdat.data[0] >= 32768) - meshVal = ((float)recdat.data[0] - 65536) / 1000; - else - meshVal = ((float)recdat.data[0]) / 1000; + DEBUG_ECHOLNPGM("meshPoint ", meshPoint, " xPnt ", xPnt, " yPnt ", yPnt); + + float meshVal = float(recdat.data[0] - (recdat.data[0] >= 32768 ? 65536 : 0)) / 1000; DEBUG_ECHOLNPGM("meshVal ", meshVal); - meshVal = constrain(meshVal, Z_PROBE_LOW_POINT, Z_CLEARANCE_BETWEEN_PROBES); + LIMIT(meshVal, Z_PROBE_LOW_POINT, Z_CLEARANCE_BETWEEN_PROBES); DEBUG_ECHOLNPGM("Constrain meshVal ", meshVal); - xy_uint8_t point = {xPnt, yPnt}; + xy_uint8_t point = { xPnt, yPnt }; setMeshPoint(point, meshVal); - rtscheck.RTS_SndData((meshVal * 1000), recdat.addr); + rtscheck.RTS_SndData(meshVal * 1000, recdat.addr); break; } @@ -1892,7 +1747,7 @@ namespace ExtUI { void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false, char fillChar=' ') { const char* myvalues = static_cast(values); - bool strend = !myvalues; + bool strend = !myvalues; DWIN_SERIAL.write(FHONE); DWIN_SERIAL.write(FHTWO); DWIN_SERIAL.write(valueslen + 3); @@ -1904,7 +1759,7 @@ namespace ExtUI { if (!strend) x = *myvalues++; if ((isstr && !x) || strend) { strend = true; - x = fillChar; + x = fillChar; } DWIN_SERIAL.write(x); } @@ -1915,29 +1770,19 @@ namespace ExtUI { LIMIT(Settings.screen_brightness, 10, 100); // Prevent a possible all-dark screen LIMIT(Settings.standby_time_seconds, 10, 655); // Prevent a possible all-dark screen for standby, yet also don't go higher than the DWIN limitation - - unsigned char cfg_bits = 0x0; - // #if ENABLED(DWINOS_4) - cfg_bits |= 1UL << 7; // 7: Enable Control - // #endif - cfg_bits |= 1UL << 5; // 5: load 22 touch file - cfg_bits |= 1UL << 4; // 4: auto-upload should always be enabled - if (Settings.display_sound) cfg_bits |= 1UL << 3; // 3: audio - if (Settings.display_standby) cfg_bits |= 1UL << 2; // 2: backlight on standby - if (Settings.screen_rotation == 10) cfg_bits |= 1UL << 1; // 1 & 0: Inversion - #if ANY(MachineCR10Smart, MachineCR10SmartPro ) - cfg_bits |= 1UL << 0; // Portrait Mode or 800x480 display has 0 point rotated 90deg from 480x272 display - #endif - - - - const unsigned char config_set[] = { - #if ENABLED(DWINOS_4) - 0x5A, 0x00, (unsigned char)(cfg_bits >> 8U), (unsigned char)(cfg_bits & 0xFFU) - #else - 0x5A, 0x00, 0xFF, cfg_bits - #endif - }; + unsigned char cfg_bits = 0x0 + | _BV(7) // 7: Enable Control ... TERN0(DWINOS_4, _BV(7)) + | _BV(5) // 5: load 22 touch file + | _BV(4) // 4: auto-upload should always be enabled + | (Settings.display_sound ? _BV(3) : 0) // 3: audio + | (Settings.display_standby ? _BV(2) : 0) // 2: backlight on standby + | (Settings.screen_rotation == 10 ? _BV(1) : 0) // 1 & 0: Inversion + #if EITHER(MachineCR10Smart, MachineCR10SmartPro) + | _BV(0) // Portrait Mode or 800x480 display has 0 point rotated 90deg from 480x272 display + #endif + ; + + const unsigned char config_set[] = { 0x5A, 0x00, TERN(DWINOS_4, 0x00, 0xFF), cfg_bits }; WriteVariable(0x80 /*System_Config*/, config_set, sizeof(config_set)); // Standby brightness (LED_Config) @@ -2044,8 +1889,7 @@ namespace ExtUI { void onPrintTimerStarted() { DEBUG_ECHOLNPGM("==onPrintTimerStarted=="); - if (waitway == 7) - return; + if (waitway == 7) return; PrinterStatusKey[1] = 3; InforShowStatus = true; delay_ms(1); @@ -2110,11 +1954,7 @@ namespace ExtUI { case PAUSE_MESSAGE_PURGE: { rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); char newMsg[40] = "Yes to "; - if (TERN1(FILAMENT_RUNOUT_SENSOR, (!ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()))) - strcat_P(newMsg, PSTR("Continue")); - else - strcat_P(newMsg, PSTR("Disable ")); - + strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); strcat_P(newMsg, PSTR(" No to Purge")); onStatusChanged(newMsg); break; @@ -2124,11 +1964,7 @@ namespace ExtUI { case PAUSE_MESSAGE_OPTION: { rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); char newMsg[40] = "Yes to "; - if (TERN1(FILAMENT_RUNOUT_SENSOR, (!ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()))) - strcat_P(newMsg, PSTR("Continue")); - else - strcat_P(newMsg, PSTR("Disable ")); - + strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); strcat_P(newMsg, PSTR(" No to Purge")); onStatusChanged(newMsg); break; @@ -2212,9 +2048,9 @@ namespace ExtUI { uint8_t abl_probe_index = 0; for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { - const bool zig = (outer & 1); // != ((PR_OUTER_END) & 1); + const bool zig = outer & 1; // != ((PR_OUTER_END) & 1); const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; - if (x_Point == xpos && outer == ypos) + if (point.x == xpos && outer == ypos) rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); ++abl_probe_index; } @@ -2283,7 +2119,7 @@ namespace ExtUI { uint8_t abl_probe_index = 0; for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { - const bool zig = (outer & 1); + const bool zig = outer & 1; const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); ++abl_probe_index; @@ -2339,11 +2175,9 @@ namespace ExtUI { uint8_t abl_probe_index = 0; for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { - uint8_t x_Point = inner; - bool zig = (outer & 1); - if (zig) x_Point = (GRID_MAX_POINTS_X - 1) - inner; - xy_uint8_t point = {x_Point, outer}; - rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); + const bool zig = outer & 1; + const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; + rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + abl_probe_index * 2); ++abl_probe_index; } diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 45861a8252355..3ce7a5aa2b3a5 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -82,6 +82,7 @@ namespace Language_en { LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); + LSTR MSG_Z_AFTER_HOME = _UxGT("Z After Homing"); LSTR MSG_FILAMENT_SET = _UxGT("Filament Settings"); LSTR MSG_FILAMENT_MAN = _UxGT("Filament Management"); LSTR MSG_MANUAL_LEVELING = _UxGT("Manual Leveling"); @@ -133,6 +134,7 @@ namespace Language_en { LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Preheat $ Bed"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Preheat $ Conf"); #endif + LSTR MSG_PREHEAT_HOTEND = _UxGT("Preheat Hotend"); LSTR MSG_PREHEAT_CUSTOM = _UxGT("Preheat Custom"); LSTR MSG_COOLDOWN = _UxGT("Cooldown"); @@ -266,6 +268,7 @@ namespace Language_en { LSTR MSG_UBL_INVALID_SLOT = _UxGT("First Select a Mesh Slot"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i Loaded"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i Saved"); + LSTR MSG_MESH_ACTIVE = _UxGT("Mesh %i active"); LSTR MSG_UBL_NO_STORAGE = _UxGT("No Storage"); LSTR MSG_UBL_SAVE_ERROR = _UxGT("Err: UBL Save"); LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Err: UBL Restore"); @@ -323,6 +326,7 @@ namespace Language_en { LSTR MSG_MOVE_01IN = _UxGT("Move 0.1in"); LSTR MSG_MOVE_05IN = _UxGT("Move 0.5in"); LSTR MSG_MOVE_1IN = _UxGT("Move 1.0in"); + LSTR MSG_LIVE_MOVE = _UxGT("Live Move"); LSTR MSG_SPEED = _UxGT("Speed"); LSTR MSG_BED_Z = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); @@ -538,6 +542,7 @@ namespace Language_en { LSTR MSG_SINGLENOZZLE_WIPE_RETRACT = _UxGT("Wipe Retract"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Retract Speed"); LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Park Head"); + LSTR MSG_PARK_FAILED = _UxGT("Head cannot be parked"); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Recover Speed"); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Fan Speed"); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Fan Time"); @@ -554,7 +559,12 @@ namespace Language_en { LSTR MSG_FILAMENTUNLOAD = _UxGT("Unload Filament"); LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Unload *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All"); - LSTR MSG_ATTACH_MEDIA = _UxGT("Attach ") MEDIA_TYPE_EN; + #if ENABLED(MULTI_VOLUME) + LSTR MSG_ATTACH_MEDIA = _UxGT("Attach SD Card"); + LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Attach USB Drive"); + #else + LSTR MSG_ATTACH_MEDIA = _UxGT("Attach ") MEDIA_TYPE_EN; + #endif LSTR MSG_CHANGE_MEDIA = _UxGT("Change ") MEDIA_TYPE_EN; LSTR MSG_RELEASE_MEDIA = _UxGT("Release ") MEDIA_TYPE_EN; LSTR MSG_ZPROBE_OUT = _UxGT("Z Probe Past Bed"); @@ -638,6 +648,7 @@ namespace Language_en { LSTR MSG_MESH_LEVELING = _UxGT("Mesh Leveling"); LSTR MSG_MESH_DONE = _UxGT("Mesh probing done"); LSTR MSG_INFO_STATS_MENU = _UxGT("Printer Stats"); + LSTR MSG_RESET_STATS = _UxGT("Reset Print Stats?"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Board Info"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); LSTR MSG_INFO_EXTRUDERS = _UxGT("Extruders"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index c5df604517ba0..ff12703ca94c5 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1650,6 +1650,7 @@ void MarlinUI::init() { TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR))); LCD_MESSAGE(MSG_PRINT_ABORTED); TERN_(HAS_MARLINUI_MENU, return_to_status()); + TERN_(DWIN_LCD_PROUI, HMI_flag.abort_flag = true); } #if BOTH(HAS_MARLINUI_MENU, PSU_CONTROL) diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 47b856147cc0c..81b36d2b01a94 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -282,7 +282,10 @@ void menu_main() { if (card_detected) { if (!card_open) { #if HAS_SD_DETECT - GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media + GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Change Media + #if ENABLED(MULTI_VOLUME) + GCODES_ITEM(MSG_ATTACH_USB_MEDIA, F("M21U")); // M21 Attach USB Media + #endif #else // - or - ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media queue.inject(F("M22")); @@ -300,7 +303,10 @@ void menu_main() { #if HAS_SD_DETECT ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" #else - GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media + GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Attach Media + #if ENABLED(MULTI_VOLUME) + GCODES_ITEM(MSG_ATTACH_USB_MEDIA, F("M21U")); // M21 Attach USB Media + #endif #endif } // END MEDIA MENU @@ -391,7 +397,10 @@ void menu_main() { if (card_detected) { if (!card_open) { #if HAS_SD_DETECT - GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media + GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Change Media + #if ENABLED(MULTI_VOLUME) + GCODES_ITEM(MSG_ATTACH_USB_MEDIA, F("M21U")); // M21 Attach USB Media + #endif #else // - or - ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media queue.inject(F("M22")); @@ -409,7 +418,10 @@ void menu_main() { #if HAS_SD_DETECT ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" #else - GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media + GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Attach Media + #if ENABLED(MULTI_VOLUME) + GCODES_ITEM(MSG_ATTACH_USB_MEDIA, F("M21U")); // M21 Attach USB Media + #endif #endif } // END MEDIA MENU diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp index dacdc14f32969..9a54351762765 100644 --- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp +++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp @@ -223,195 +223,195 @@ extern const uint8_t NotoSans_Medium_14[8358] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0x00a0 " " 0,0,0,5,0,0, - // 0x00a1 ¡ + // 0x00a1 ¡ 3,15,15,5,1,252,16,188,188,16,0,52,52,116,116,120,120,120,184,184,84, - // 0x00a2 ¢ + // 0x00a2 ¢ 8,15,30,11,1,255,0,96,0,176,7,255,31,155,61,0,60,0,120,0,120,0,124,0,60,0,47,150,11,255,0,180,0,176,0,0, - // 0x00a3 £ + // 0x00a3 £ 11,14,42,11,0,0,0,106,64,2,255,224,7,192,64,7,128,0,11,64,0,11,64,0,47,234,0,127,255,0,11,64,0,11,64,0,11,64,0,15,0,0,127,255,240,127,255,244, - // 0x00a4 ¤ + // 0x00a4 ¤ 9,9,27,11,1,2,97,66,64,127,255,64,61,30,0,52,7,0,48,7,0,56,11,0,62,127,0,187,251,64,0,1,0, - // 0x00a5 Â¥ + // 0x00a5 ¥ 11,14,42,11,0,0,100,0,100,60,0,240,45,1,224,15,3,192,11,71,64,3,207,0,2,237,0,10,254,128,15,255,192,0,180,0,10,254,128,10,254,128,0,180,0,0,180,0, - // 0x00a6 ¦ + // 0x00a6 ¦ 2,20,20,10,4,251,16,176,176,176,176,176,176,112,0,0,0,0,112,176,176,176,176,176,176,96, - // 0x00a7 § + // 0x00a7 § 8,16,32,10,1,255,5,144,63,252,180,4,180,0,62,64,63,240,176,124,176,29,184,29,63,188,6,248,0,61,0,29,229,124,191,224,0,0, - // 0x00a8 ¨ + // 0x00a8 ¨ 5,3,6,11,3,11,225,192,225,192,0,0, - // 0x00a9 © + // 0x00a9 © 14,15,60,16,1,255,0,106,128,0,7,213,188,0,29,0,11,0,52,47,210,192,160,245,64,208,209,208,0,160,194,192,0,112,194,192,0,112,193,192,0,112,160,224,0,160,112,127,208,192,44,5,67,64,11,64,46,0,1,255,224,0,0,0,0,0, - // 0x00aa ª + // 0x00aa ª 6,7,14,7,0,7,26,128,41,240,0,112,47,240,112,112,117,240,46,32, - // 0x00ab « + // 0x00ab « 8,8,16,10,1,1,7,7,31,31,60,60,240,240,244,244,60,60,15,15,6,7, - // 0x00ac ¬ + // 0x00ac ¬ 9,6,18,11,1,2,85,85,64,255,255,192,0,2,192,0,2,192,0,2,192,0,1,128, - // 0x00ad ­ + // 0x00ad ­ 6,2,4,6,0,4,127,208,63,208, - // 0x00ae ® + // 0x00ae ® 14,15,60,16,1,255,0,106,128,0,7,213,188,0,29,0,11,0,52,191,130,192,160,181,224,208,208,176,224,160,192,177,224,112,192,191,128,112,192,179,128,112,160,177,208,160,112,176,176,192,44,80,23,64,11,64,46,0,1,255,224,0,0,0,0,0, - // 0x00af ¯ + // 0x00af ¯ 10,2,6,10,0,14,255,255,208,170,170,144, - // 0x00b0 ° + // 0x00b0 ° 6,7,14,8,1,7,26,64,122,224,224,112,208,112,240,176,63,192,0,0, - // 0x00b1 ± + // 0x00b1 ± 9,12,36,11,1,0,0,128,0,1,192,0,1,192,0,1,192,0,171,234,128,255,255,192,1,192,0,1,192,0,1,192,0,0,128,0,170,170,128,255,255,192, - // 0x00b2 ² + // 0x00b2 ² 6,9,18,7,0,7,47,208,36,240,0,176,0,224,3,128,14,0,61,80,191,240,0,0, - // 0x00b3 ³ + // 0x00b3 ³ 6,9,18,7,0,7,63,208,32,240,0,176,11,192,6,224,0,112,64,176,127,208,0,0, - // 0x00b4 ´ + // 0x00b4 ´ 4,4,4,6,1,11,25,61,180,64, - // 0x00b5 µ + // 0x00b5 µ 10,15,45,12,1,251,120,2,208,120,2,208,120,2,208,120,2,208,120,2,208,120,2,208,120,2,208,124,3,208,127,175,208,123,248,208,120,0,0,120,0,0,120,0,0,120,0,0,36,0,0, - // 0x00b6 ¶ + // 0x00b6 ¶ 10,18,54,12,1,253,1,85,64,47,255,224,127,248,160,255,248,160,255,248,160,255,248,160,255,248,160,191,248,160,63,248,160,31,248,160,0,40,160,0,40,160,0,40,160,0,40,160,0,40,160,0,40,160,0,40,160,0,16,64, - // 0x00b7 · + // 0x00b7 · 3,4,4,5,1,5,16,188,184,0, - // 0x00b8 ¸ + // 0x00b8 ¸ 4,5,5,4,0,251,56,61,11,174,100, - // 0x00b9 ¹ + // 0x00b9 ¹ 4,9,9,7,1,7,31,191,143,15,15,15,15,15,0, - // 0x00ba º + // 0x00ba º 7,7,14,7,0,7,6,128,61,176,112,52,112,56,112,52,61,176,11,128, - // 0x00bb » + // 0x00bb » 8,8,16,10,1,1,160,160,184,184,61,45,15,15,15,15,61,61,180,180,160,160, - // 0x00bc ¼ + // 0x00bc ¼ 14,14,56,15,1,0,9,0,24,0,126,0,56,0,222,0,176,0,14,0,208,0,14,3,192,0,14,7,64,0,14,14,15,64,14,44,31,64,9,52,55,64,0,240,215,64,1,210,199,64,3,131,255,208,11,1,91,128,14,0,7,64, - // 0x00bd ½ + // 0x00bd ½ 15,14,56,15,0,0,2,64,9,0,31,64,28,0,119,64,56,0,3,64,176,0,3,64,208,0,3,67,193,0,3,71,111,224,3,78,20,116,2,108,0,116,0,52,0,240,0,176,2,192,1,208,11,0,3,128,46,80,11,0,63,244, - // 0x00be ¾ + // 0x00be ¾ 15,14,56,15,0,0,26,128,1,128,122,224,3,64,0,176,15,0,1,224,29,0,31,192,56,0,0,176,176,0,0,112,208,240,186,243,195,240,42,71,74,240,0,14,28,240,0,44,52,240,0,56,127,252,0,240,21,244,1,208,0,240, - // 0x00bf ¿ + // 0x00bf ¿ 8,15,30,9,0,252,0,64,1,240,1,240,0,64,0,0,0,240,0,224,3,208,15,64,60,0,120,0,180,0,125,6,47,255,6,164, - // 0x00c0 À + // 0x00c0 À 12,18,54,12,0,0,1,160,0,0,244,0,0,44,0,0,5,0,0,40,0,0,126,0,0,191,0,0,247,64,1,227,192,3,195,192,3,193,224,11,64,240,15,234,244,31,255,248,45,0,60,60,0,45,120,0,31,244,0,15, - // 0x00c1 Á + // 0x00c1 Á 12,18,54,12,0,0,0,2,128,0,11,128,0,30,0,0,20,0,0,40,0,0,126,0,0,191,0,0,247,64,1,227,192,3,195,192,3,193,224,11,64,240,15,234,244,31,255,248,45,0,60,60,0,45,120,0,31,244,0,15, - // 0x00c2  + // 0x00c2  12,18,54,12,0,0,0,40,0,0,191,0,2,211,192,1,0,80,0,40,0,0,126,0,0,191,0,0,247,64,1,227,192,3,195,192,3,193,224,11,64,240,15,234,244,31,255,248,45,0,60,60,0,45,120,0,31,244,0,15, - // 0x00c3 à + // 0x00c3 à 12,17,51,12,0,0,2,244,160,3,175,208,1,1,0,0,40,0,0,126,0,0,191,0,0,247,64,1,227,192,3,195,192,3,193,224,11,64,240,15,234,244,31,255,248,45,0,60,60,0,45,120,0,31,244,0,15, - // 0x00c4 Ä + // 0x00c4 Ä 12,17,51,12,0,0,1,194,192,1,211,192,0,0,0,0,40,0,0,126,0,0,191,0,0,247,64,1,227,192,3,195,192,3,193,224,11,64,240,15,234,244,31,255,248,45,0,60,60,0,45,120,0,31,244,0,15, - // 0x00c5 Ã… + // 0x00c5 Å 12,17,51,12,0,0,0,40,0,0,171,0,0,195,64,0,191,0,0,127,0,0,191,0,0,247,64,1,227,192,3,195,192,3,193,224,11,64,240,15,234,244,31,255,248,45,0,60,60,0,45,120,0,31,244,0,15, - // 0x00c6 Æ + // 0x00c6 Æ 16,14,56,17,0,0,0,6,170,170,0,15,255,255,0,45,184,0,0,60,120,0,0,180,120,0,0,240,120,0,2,224,127,254,3,192,127,254,7,234,248,0,15,255,248,0,30,0,120,0,61,0,120,0,124,0,127,255,244,0,127,255, - // 0x00c7 Ç + // 0x00c7 Ç 10,19,57,12,1,251,0,106,128,7,255,240,31,128,96,61,0,0,124,0,0,180,0,0,244,0,0,244,0,0,244,0,0,184,0,0,124,0,0,63,0,0,15,234,240,2,255,224,0,60,0,0,46,0,0,11,0,0,175,0,0,100,0, - // 0x00c8 È + // 0x00c8 È 8,18,36,11,2,0,25,0,15,0,3,128,0,64,170,168,255,253,240,0,240,0,240,0,240,0,255,252,255,252,240,0,240,0,240,0,240,0,255,253,255,253, - // 0x00c9 É + // 0x00c9 É 8,18,36,11,2,0,0,100,0,240,3,192,1,0,170,168,255,253,240,0,240,0,240,0,240,0,255,252,255,252,240,0,240,0,240,0,240,0,255,253,255,253, - // 0x00ca Ê + // 0x00ca Ê 8,18,36,11,2,0,6,128,15,224,60,116,80,4,170,168,255,253,240,0,240,0,240,0,240,0,255,252,255,252,240,0,240,0,240,0,240,0,255,253,255,253, - // 0x00cb Ë + // 0x00cb Ë 8,17,34,11,2,0,56,52,60,116,0,0,170,168,255,253,240,0,240,0,240,0,240,0,255,252,255,252,240,0,240,0,240,0,240,0,255,253,255,253, - // 0x00cc ÃŒ + // 0x00cc Ì 6,18,36,7,0,0,40,0,46,0,11,64,1,64,42,160,63,240,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,31,144,127,240, - // 0x00cd Í + // 0x00cd Í 6,18,36,7,0,0,0,160,1,224,3,128,5,0,42,160,63,240,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,31,144,127,240, - // 0x00ce ÃŽ + // 0x00ce Î 7,18,36,7,0,0,6,64,47,192,120,240,80,20,42,160,63,240,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,31,144,127,240, - // 0x00cf Ï + // 0x00cf Ï 6,17,34,7,0,0,116,176,116,176,0,0,42,160,63,240,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,31,144,127,240, - // 0x00d0 Ð + // 0x00d0 Ð 13,14,56,14,0,0,10,169,0,0,15,255,240,0,15,1,252,0,15,0,47,0,15,0,15,64,15,0,11,128,111,168,7,128,127,252,7,128,15,0,7,128,15,0,15,64,15,0,31,0,15,0,126,0,15,175,248,0,15,255,128,0, - // 0x00d1 Ñ + // 0x00d1 Ñ 11,17,51,15,2,0,7,225,192,14,191,64,4,5,0,164,0,40,252,0,60,254,0,60,239,0,60,231,192,60,227,208,60,224,240,60,224,184,60,224,61,60,224,31,60,224,11,188,224,3,252,224,1,252,224,0,252, - // 0x00d2 Ã’ + // 0x00d2 Ò 13,19,76,15,1,255,0,160,0,0,0,184,0,0,0,29,0,0,0,5,0,0,0,174,64,0,11,255,244,0,47,64,125,0,61,0,31,0,120,0,15,64,180,0,11,128,244,0,7,128,244,0,7,128,180,0,7,128,184,0,11,128,124,0,15,0,62,0,62,0,15,234,252,0,2,255,224,0,0,0,0,0, - // 0x00d3 Ó + // 0x00d3 Ó 13,19,76,15,1,255,0,1,144,0,0,7,192,0,0,15,0,0,0,20,0,0,0,174,64,0,11,255,244,0,47,64,125,0,61,0,31,0,120,0,15,64,180,0,11,128,244,0,7,128,244,0,7,128,180,0,7,128,184,0,11,128,124,0,15,0,62,0,62,0,15,234,252,0,2,255,224,0,0,0,0,0, - // 0x00d4 Ô + // 0x00d4 Ô 13,19,76,15,1,255,0,25,0,0,0,127,64,0,1,226,192,0,1,64,80,0,0,174,64,0,11,255,244,0,47,64,125,0,61,0,31,0,120,0,15,64,180,0,11,128,244,0,7,128,244,0,7,128,180,0,7,128,184,0,11,128,124,0,15,0,62,0,62,0,15,234,252,0,2,255,224,0,0,0,0,0, - // 0x00d5 Õ + // 0x00d5 Õ 13,18,72,15,1,255,1,248,112,0,3,175,224,0,1,1,64,0,0,174,64,0,11,255,244,0,47,64,125,0,61,0,31,0,120,0,15,64,180,0,11,128,244,0,7,128,244,0,7,128,180,0,7,128,184,0,11,128,124,0,15,0,62,0,62,0,15,234,252,0,2,255,224,0,0,0,0,0, - // 0x00d6 Ö + // 0x00d6 Ö 13,18,72,15,1,255,0,209,192,0,0,226,192,0,0,0,0,0,0,174,64,0,11,255,244,0,47,64,125,0,61,0,31,0,120,0,15,64,180,0,11,128,244,0,7,128,244,0,7,128,180,0,7,128,184,0,11,128,124,0,15,0,62,0,62,0,15,234,252,0,2,255,224,0,0,0,0,0, - // 0x00d7 × + // 0x00d7 × 9,9,27,11,1,2,32,2,0,120,15,64,30,61,0,7,244,0,3,240,0,15,184,0,61,30,0,180,7,64,0,0,0, - // 0x00d8 Ø + // 0x00d8 Ø 13,15,60,15,1,255,0,174,78,0,11,255,253,0,47,64,189,0,61,0,255,0,120,2,207,64,180,7,139,128,244,15,7,128,244,44,7,192,244,116,7,128,184,240,11,128,127,192,15,0,63,64,62,0,31,234,252,0,62,255,224,0,4,0,0,0, - // 0x00d9 Ù + // 0x00d9 Ù 12,19,57,14,1,255,1,144,0,0,244,0,0,60,0,0,4,0,36,0,24,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,61,60,0,60,62,0,188,15,235,240,2,255,128,0,0,0, - // 0x00da Ú + // 0x00da Ú 12,19,57,14,1,255,0,2,128,0,15,64,0,45,0,0,20,0,36,0,24,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,61,60,0,60,62,0,188,15,235,240,2,255,128,0,0,0, - // 0x00db Û + // 0x00db Û 12,19,57,14,1,255,0,40,0,0,255,0,2,215,128,1,0,64,36,0,24,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,61,60,0,60,62,0,188,15,235,240,2,255,128,0,0,0, - // 0x00dc Ãœ + // 0x00dc Ü 12,18,54,14,1,255,2,195,128,2,195,128,0,0,0,36,0,24,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,45,124,0,61,60,0,60,62,0,188,15,235,240,2,255,128,0,0,0, - // 0x00dd Ý + // 0x00dd Ý 11,18,54,11,0,0,0,6,64,0,31,0,0,60,0,0,16,0,96,0,40,124,0,180,61,0,240,31,2,208,15,71,192,7,207,64,2,239,0,0,252,0,0,184,0,0,120,0,0,120,0,0,120,0,0,120,0,0,120,0, - // 0x00de Þ + // 0x00de Þ 9,14,42,12,2,0,144,0,0,240,0,0,245,0,0,255,252,0,245,191,0,240,15,128,240,7,128,240,11,128,240,15,64,250,190,0,255,244,0,240,0,0,240,0,0,240,0,0, - // 0x00df ß + // 0x00df ß 11,16,48,12,1,255,1,84,0,31,255,128,61,7,192,120,2,208,120,3,192,120,15,64,120,60,0,120,60,0,120,63,0,120,15,208,120,1,240,120,0,184,120,0,120,120,229,244,120,191,208,0,0,0, - // 0x00e0 à + // 0x00e0 à 9,16,48,11,1,255,10,0,0,11,128,0,2,208,0,0,80,0,1,80,0,47,253,0,41,31,0,0,11,64,0,11,64,47,255,64,189,11,64,240,11,64,240,15,64,249,191,64,63,227,64,0,0,0, - // 0x00e1 á + // 0x00e1 á 9,16,48,11,1,255,0,25,0,0,124,0,0,240,0,1,64,0,1,80,0,47,253,0,41,31,0,0,11,64,0,11,64,47,255,64,189,11,64,240,11,64,240,15,64,249,191,64,63,227,64,0,0,0, - // 0x00e2 â + // 0x00e2 â 9,16,48,11,1,255,1,144,0,7,244,0,30,44,0,20,5,0,1,80,0,47,253,0,41,31,0,0,11,64,0,11,64,47,255,64,189,11,64,240,11,64,240,15,64,249,191,64,63,227,64,0,0,0, - // 0x00e3 ã + // 0x00e3 ã 9,15,45,11,1,255,31,135,0,58,254,0,16,20,0,1,80,0,47,253,0,41,31,0,0,11,64,0,11,64,47,255,64,189,11,64,240,11,64,240,15,64,249,191,64,63,227,64,0,0,0, - // 0x00e4 ä + // 0x00e4 ä 9,15,45,11,1,255,13,28,0,13,44,0,0,0,0,1,80,0,47,253,0,41,31,0,0,11,64,0,11,64,47,255,64,189,11,64,240,11,64,240,15,64,249,191,64,63,227,64,0,0,0, - // 0x00e5 Ã¥ + // 0x00e5 å 9,17,51,11,1,255,1,144,0,7,116,0,9,40,0,7,180,0,1,64,0,1,80,0,47,253,0,41,31,0,0,11,64,0,11,64,47,255,64,189,11,64,240,11,64,240,15,64,249,191,64,63,227,64,0,0,0, - // 0x00e6 æ + // 0x00e6 æ 15,12,48,17,1,255,1,80,21,0,63,252,255,208,36,47,209,240,0,15,128,120,0,15,64,120,47,255,255,252,189,15,85,80,240,15,64,0,240,31,192,0,249,186,249,180,63,224,191,240,0,0,0,0, - // 0x00e7 ç + // 0x00e7 ç 8,16,32,9,1,251,1,80,31,254,62,88,184,0,240,0,240,0,240,0,244,0,184,0,63,173,11,253,1,192,1,240,0,116,6,240,2,64, - // 0x00e8 è + // 0x00e8 è 9,16,48,11,1,255,10,0,0,11,128,0,1,208,0,0,80,0,1,80,0,15,253,0,61,31,64,180,7,128,244,7,192,255,255,192,245,85,64,244,0,0,120,0,0,63,155,64,11,255,64,0,0,0, - // 0x00e9 é + // 0x00e9 é 9,16,48,11,1,255,0,25,0,0,124,0,0,240,0,1,64,0,1,80,0,15,253,0,61,31,64,180,7,128,244,7,192,255,255,192,245,85,64,244,0,0,120,0,0,63,155,64,11,255,64,0,0,0, - // 0x00ea ê + // 0x00ea ê 9,16,48,11,1,255,1,144,0,7,244,0,30,44,0,20,5,0,1,80,0,15,253,0,61,31,64,180,7,128,244,7,192,255,255,192,245,85,64,244,0,0,120,0,0,63,155,64,11,255,64,0,0,0, - // 0x00eb ë + // 0x00eb ë 9,15,45,11,1,255,13,28,0,14,44,0,0,0,0,1,80,0,15,253,0,61,31,64,180,7,128,244,7,192,255,255,192,245,85,64,244,0,0,120,0,0,63,155,64,11,255,64,0,0,0, - // 0x00ec ì + // 0x00ec ì 4,15,15,5,0,0,160,124,30,5,0,30,30,30,30,30,30,30,30,30,30, - // 0x00ed í + // 0x00ed í 5,15,30,5,1,0,6,64,31,0,60,0,16,0,0,0,120,0,120,0,120,0,120,0,120,0,120,0,120,0,120,0,120,0,120,0, - // 0x00ee î + // 0x00ee î 7,15,30,5,255,0,6,64,31,208,56,180,80,20,0,0,7,128,7,128,7,128,7,128,7,128,7,128,7,128,7,128,7,128,7,128, - // 0x00ef ï + // 0x00ef ï 6,14,28,5,0,0,225,192,225,208,0,0,0,0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,30,0,30,0, - // 0x00f0 ð + // 0x00f0 ð 10,16,48,12,1,255,1,0,0,7,219,0,1,253,0,7,253,0,10,15,0,0,7,128,11,251,192,63,175,208,184,3,208,240,2,224,240,1,224,240,2,208,184,3,192,62,111,128,11,253,0,0,0,0, - // 0x00f1 ñ + // 0x00f1 ñ 10,14,42,12,1,0,11,211,64,29,255,0,20,4,0,0,20,0,119,255,64,127,91,192,124,3,208,120,2,208,120,2,208,120,2,208,120,2,208,120,2,208,120,2,208,120,2,208, - // 0x00f2 ò + // 0x00f2 ò 10,16,48,12,1,255,6,64,0,3,192,0,0,224,0,0,16,0,1,80,0,31,254,0,62,95,128,184,3,192,240,2,208,240,2,224,240,2,224,244,2,208,120,3,192,63,175,128,11,253,0,0,0,0, - // 0x00f3 ó + // 0x00f3 ó 10,16,48,12,1,255,0,25,0,0,60,0,0,176,0,0,64,0,1,80,0,31,254,0,62,95,128,184,3,192,240,2,208,240,2,224,240,2,224,244,2,208,120,3,192,63,175,128,11,253,0,0,0,0, - // 0x00f4 ô + // 0x00f4 ô 10,16,48,12,1,255,1,160,0,3,248,0,15,30,0,20,1,0,1,80,0,31,254,0,62,95,128,184,3,192,240,2,208,240,2,224,240,2,224,244,2,208,120,3,192,63,175,128,11,253,0,0,0,0, - // 0x00f5 õ + // 0x00f5 õ 10,15,45,12,1,255,15,211,64,45,255,0,16,20,0,1,80,0,31,254,0,62,95,128,184,3,192,240,2,208,240,2,224,240,2,224,244,2,208,120,3,192,63,175,128,11,253,0,0,0,0, - // 0x00f6 ö + // 0x00f6 ö 10,15,45,12,1,255,15,13,0,15,13,0,0,0,0,1,80,0,31,254,0,62,95,128,184,3,192,240,2,208,240,2,224,240,2,224,244,2,208,120,3,192,63,175,128,11,253,0,0,0,0, - // 0x00f7 ÷ + // 0x00f7 ÷ 9,9,27,11,1,2,2,208,0,2,208,0,0,0,0,85,85,64,255,255,192,0,0,0,1,128,0,2,208,0,1,128,0, - // 0x00f8 ø + // 0x00f8 ø 10,12,36,12,1,255,1,81,64,31,255,192,62,95,128,184,31,192,240,58,208,240,242,224,241,210,224,247,130,208,127,3,192,63,175,128,127,253,0,16,0,0, - // 0x00f9 ù + // 0x00f9 ù 10,16,48,12,1,255,6,64,0,3,192,0,0,240,0,0,16,0,0,0,0,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,3,208,124,7,208,63,175,208,31,249,208,0,0,0, - // 0x00fa ú + // 0x00fa ú 10,16,48,12,1,255,0,10,0,0,61,0,0,180,0,0,64,0,0,0,0,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,3,208,124,7,208,63,175,208,31,249,208,0,0,0, - // 0x00fb û + // 0x00fb û 10,16,48,12,1,255,0,160,0,3,252,0,11,30,0,4,1,0,0,0,0,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,3,208,124,7,208,63,175,208,31,249,208,0,0,0, - // 0x00fc ü + // 0x00fc ü 10,15,45,12,1,255,11,14,0,11,14,0,0,0,0,0,0,0,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,2,208,184,3,208,124,7,208,63,175,208,31,249,208,0,0,0, - // 0x00fd ý + // 0x00fd ý 10,20,60,10,0,251,0,10,0,0,61,0,0,180,0,0,80,0,0,0,0,180,1,224,124,3,208,60,3,192,30,7,128,15,15,0,11,79,0,7,157,0,3,252,0,1,248,0,0,244,0,0,240,0,1,224,0,7,192,0,191,64,0,100,0,0, - // 0x00fe þ + // 0x00fe þ 10,20,60,12,1,251,20,0,0,120,0,0,120,0,0,120,0,0,120,20,0,122,255,64,127,91,192,124,2,208,120,1,224,120,1,240,120,1,240,124,1,224,124,3,208,127,175,192,122,254,0,120,0,0,120,0,0,120,0,0,120,0,0,36,0,0, - // 0x00ff ÿ + // 0x00ff ÿ 10,19,57,10,0,251,11,14,0,11,14,0,0,0,0,0,0,0,180,1,224,124,3,208,60,3,192,30,7,128,15,15,0,11,79,0,7,157,0,3,252,0,1,248,0,0,244,0,0,240,0,1,224,0,7,192,0,191,64,0,100,0,0, }; diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp index f9c5970c379a7..13699013382c3 100644 --- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp +++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp @@ -223,195 +223,195 @@ extern const uint8_t NotoSans_Medium_16[10298] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0x00a0 " " 0,0,0,6,0,0, - // 0x00a1 ¡ + // 0x00a1 ¡ 4,16,16,6,1,252,60,125,61,0,0,60,60,60,60,60,60,60,60,125,125,125, - // 0x00a2 ¢ + // 0x00a2 ¢ 9,17,51,13,2,255,0,176,0,0,240,0,11,255,64,63,255,64,125,0,0,248,0,0,244,0,0,244,0,0,244,0,0,244,0,0,248,0,0,126,0,64,63,255,128,7,255,64,0,240,0,0,240,0,0,0,0, - // 0x00a3 £ + // 0x00a3 £ 12,16,48,13,0,0,0,47,228,0,255,252,3,240,24,3,208,0,3,192,0,3,192,0,3,192,0,63,255,208,63,255,224,3,192,0,3,192,0,3,192,0,7,192,0,31,64,0,63,255,255,127,255,255, - // 0x00a4 ¤ + // 0x00a4 ¤ 10,11,33,13,1,2,16,0,16,122,254,240,47,239,208,45,3,192,60,0,208,56,0,224,60,1,208,31,75,192,63,255,224,52,84,160,0,0,0, - // 0x00a5 Â¥ + // 0x00a5 ¥ 12,16,48,13,0,0,104,0,10,61,0,46,47,0,60,15,0,184,11,128,240,3,194,224,2,227,192,0,255,64,10,255,164,15,255,248,0,61,0,5,126,80,15,255,248,5,126,80,0,61,0,0,61,0, - // 0x00a6 ¦ + // 0x00a6 ¦ 2,23,23,12,5,250,160,240,240,240,240,240,240,240,176,0,0,0,0,16,240,240,240,240,240,240,240,240,0, - // 0x00a7 § + // 0x00a7 § 9,18,54,11,1,255,6,249,0,63,255,64,120,1,0,120,0,0,62,64,0,31,244,0,61,190,0,116,15,64,180,3,128,124,7,128,47,159,0,7,254,0,0,47,64,0,11,128,0,11,128,250,175,64,127,248,0,0,0,0, - // 0x00a8 ¨ + // 0x00a8 ¨ 7,3,6,13,3,13,180,120,180,120,0,0, - // 0x00a9 © + // 0x00a9 © 16,17,68,18,1,255,0,27,248,0,2,249,91,128,11,64,0,240,44,6,228,60,52,47,188,13,112,120,0,11,224,176,0,7,208,240,0,3,208,240,0,3,224,240,0,7,176,116,0,11,112,62,88,14,44,11,248,44,15,0,0,180,3,224,7,208,0,127,254,0,0,0,0,0, - // 0x00aa ª + // 0x00aa ª 7,8,16,8,0,8,27,224,41,184,0,44,11,252,61,44,116,60,62,252,10,72, - // 0x00ab « + // 0x00ab « 10,10,30,12,1,1,1,0,64,3,194,224,15,71,192,62,15,64,188,61,0,248,61,0,61,31,0,31,11,192,7,194,224,2,64,128, - // 0x00ac ¬ + // 0x00ac ¬ 11,7,21,13,1,2,170,170,164,255,255,244,0,0,116,0,0,116,0,0,116,0,0,116,0,0,0, - // 0x00ad ­ + // 0x00ad ­ 6,3,6,7,1,4,255,192,255,208,0,0, - // 0x00ae ® + // 0x00ae ® 16,17,68,18,1,255,0,27,248,0,2,249,91,128,11,64,0,240,44,42,144,60,52,63,252,13,112,60,45,11,224,60,29,7,208,60,124,3,208,63,240,3,224,60,176,7,176,60,60,11,112,60,29,14,44,60,15,44,15,0,0,180,3,224,7,208,0,127,254,0,0,0,0,0, - // 0x00af ¯ + // 0x00af ¯ 11,3,9,11,0,16,85,85,84,255,255,252,85,85,84, - // 0x00b0 ° + // 0x00b0 ° 8,8,16,9,1,8,11,208,62,184,176,44,240,29,176,44,126,184,31,224,0,0, - // 0x00b1 ± + // 0x00b1 ± 11,14,42,13,1,0,0,16,0,0,176,0,0,176,0,0,176,0,0,176,0,255,255,244,255,255,244,0,176,0,0,176,0,0,176,0,0,176,0,0,16,0,191,255,244,255,255,248, - // 0x00b2 ² + // 0x00b2 ² 7,10,20,8,0,9,10,144,63,244,16,60,0,60,0,180,1,224,7,128,30,0,127,248,127,252, - // 0x00b3 ³ + // 0x00b3 ³ 7,11,22,8,0,8,10,144,62,248,16,60,0,56,10,240,10,244,0,60,0,44,185,188,47,224,0,0, - // 0x00b4 ´ + // 0x00b4 ´ 5,4,8,7,1,13,15,128,47,0,120,0,160,0, - // 0x00b5 µ + // 0x00b5 µ 10,18,54,14,2,250,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240,240,1,240,244,2,240,248,3,240,255,191,240,251,248,240,240,0,0,240,0,0,240,0,0,240,0,0,240,0,0,80,0,0, - // 0x00b6 ¶ + // 0x00b6 ¶ 11,20,60,14,1,253,2,170,168,31,255,252,63,254,12,191,254,12,191,254,12,255,254,12,191,254,12,191,254,12,127,254,12,63,254,12,11,254,12,0,10,12,0,10,12,0,10,12,0,10,12,0,10,12,0,10,12,0,10,12,0,10,12,0,10,12, - // 0x00b7 · + // 0x00b7 · 4,4,4,6,1,5,56,125,125,0, - // 0x00b8 ¸ + // 0x00b8 ¸ 5,6,12,5,0,250,44,0,62,0,11,128,11,128,255,0,16,0, - // 0x00b9 ¹ + // 0x00b9 ¹ 5,10,20,8,1,9,6,64,47,128,251,128,71,128,7,128,7,128,7,128,7,128,7,128,3,64, - // 0x00ba º + // 0x00ba º 8,8,16,8,0,8,7,224,46,188,56,13,116,14,52,14,56,29,31,188,6,144, - // 0x00bb » + // 0x00bb » 10,10,30,12,1,1,16,0,0,244,60,0,61,47,0,31,11,128,11,195,224,7,194,240,15,75,192,61,31,0,248,61,0,96,20,0, - // 0x00bc ¼ + // 0x00bc ¼ 16,16,64,17,1,0,10,64,2,128,63,64,7,128,251,64,15,0,71,64,45,0,7,64,56,0,7,64,240,0,7,65,224,80,7,67,192,244,7,75,67,244,6,79,11,180,0,60,13,180,0,120,56,180,0,240,181,185,2,208,255,254,3,192,0,180,11,0,0,180, - // 0x00bd ½ + // 0x00bd ½ 17,16,80,18,0,0,2,128,1,144,0,31,192,3,192,0,126,192,7,64,0,18,192,15,0,0,2,192,45,0,0,2,192,56,0,0,2,192,240,100,0,2,193,215,255,0,2,195,194,7,128,1,139,64,7,128,0,14,0,11,0,0,60,0,46,0,0,120,0,184,0,0,240,2,224,0,2,208,7,234,64,3,128,11,255,128, - // 0x00be ¾ + // 0x00be ¾ 18,16,80,18,0,0,27,224,0,40,0,62,184,0,180,0,0,60,0,240,0,0,56,2,192,0,15,224,7,128,0,10,248,15,0,0,0,44,29,5,0,0,44,60,47,0,122,184,180,63,0,47,225,224,239,0,0,3,194,207,0,0,7,67,79,0,0,15,15,95,64,0,45,15,255,208,0,56,0,15,0,0,240,0,15,0, - // 0x00bf ¿ + // 0x00bf ¿ 10,17,51,10,0,251,0,124,0,0,252,0,0,188,0,0,0,0,0,0,0,0,60,0,0,120,0,0,244,0,3,224,0,31,128,0,61,0,0,124,0,0,124,0,0,125,0,128,63,255,208,11,255,128,0,0,0, - // 0x00c0 À + // 0x00c0 À 14,21,84,14,0,0,0,188,0,0,0,62,0,0,0,15,64,0,0,2,128,0,0,0,0,0,0,15,64,0,0,47,192,0,0,63,208,0,0,126,224,0,0,184,240,0,0,240,244,0,1,240,124,0,3,224,60,0,3,192,62,0,11,234,191,0,15,255,255,64,31,85,95,128,47,0,7,192,61,0,3,208,124,0,2,240,248,0,1,240, - // 0x00c1 Á + // 0x00c1 Á 14,21,84,14,0,0,0,0,248,0,0,2,240,0,0,7,128,0,0,10,0,0,0,0,0,0,0,15,64,0,0,47,192,0,0,63,208,0,0,126,224,0,0,184,240,0,0,240,244,0,1,240,124,0,3,224,60,0,3,192,62,0,11,234,191,0,15,255,255,64,31,85,95,128,47,0,7,192,61,0,3,208,124,0,2,240,248,0,1,240, - // 0x00c2  + // 0x00c2  14,21,84,14,0,0,0,31,128,0,0,63,208,0,0,244,244,0,1,128,40,0,0,0,0,0,0,15,64,0,0,47,192,0,0,63,208,0,0,126,224,0,0,184,240,0,0,240,244,0,1,240,124,0,3,224,60,0,3,192,62,0,11,234,191,0,15,255,255,64,31,85,95,128,47,0,7,192,61,0,3,208,124,0,2,240,248,0,1,240, - // 0x00c3 à + // 0x00c3 à 14,21,84,14,0,0,0,0,4,0,0,254,28,0,2,223,248,0,2,65,144,0,0,0,0,0,0,15,64,0,0,47,192,0,0,63,208,0,0,126,224,0,0,184,240,0,0,240,244,0,1,240,124,0,3,224,60,0,3,192,62,0,11,234,191,0,15,255,255,64,31,85,95,128,47,0,7,192,61,0,3,208,124,0,2,240,248,0,1,240, - // 0x00c4 Ä + // 0x00c4 Ä 14,20,80,14,0,0,0,240,180,0,0,240,180,0,0,0,0,0,0,0,0,0,0,15,64,0,0,47,192,0,0,63,208,0,0,126,224,0,0,184,240,0,0,240,244,0,1,240,124,0,3,224,60,0,3,192,62,0,11,234,191,0,15,255,255,64,31,85,95,128,47,0,7,192,61,0,3,208,124,0,2,240,248,0,1,240, - // 0x00c5 Ã… + // 0x00c5 Å 14,19,76,14,0,0,0,47,128,0,0,52,208,0,0,112,224,0,0,63,208,0,0,47,192,0,0,63,208,0,0,126,224,0,0,184,240,0,0,240,244,0,1,240,124,0,3,224,60,0,3,192,62,0,11,234,191,0,15,255,255,64,31,85,95,128,47,0,7,192,61,0,3,208,124,0,2,240,248,0,1,240, - // 0x00c6 Æ + // 0x00c6 Æ 19,16,80,20,0,0,0,2,170,170,164,0,3,255,255,248,0,11,159,149,80,0,15,15,64,0,0,46,15,64,0,0,60,15,64,0,0,188,15,64,0,0,244,15,255,240,2,240,15,255,240,3,250,175,64,0,7,255,255,64,0,15,149,95,64,0,31,0,15,64,0,62,0,15,64,0,124,0,15,255,248,248,0,15,255,248, - // 0x00c7 Ç + // 0x00c7 Ç 12,22,66,14,1,250,0,111,232,2,255,255,15,228,26,47,64,0,62,0,0,124,0,0,188,0,0,188,0,0,188,0,0,188,0,0,124,0,0,61,0,0,63,0,0,15,208,1,7,255,254,0,191,253,0,15,0,0,15,128,0,2,208,0,2,208,0,63,128,0,0,0, - // 0x00c8 È + // 0x00c8 È 9,21,63,12,2,0,31,64,0,7,192,0,1,224,0,0,96,0,0,0,0,170,170,128,255,255,192,249,85,64,244,0,0,244,0,0,244,0,0,248,0,0,255,255,128,255,255,64,244,0,0,244,0,0,244,0,0,244,0,0,244,0,0,255,255,192,255,255,192, - // 0x00c9 É + // 0x00c9 É 9,21,63,12,2,0,0,47,0,0,61,0,0,244,0,1,128,0,0,0,0,170,170,128,255,255,192,249,85,64,244,0,0,244,0,0,244,0,0,248,0,0,255,255,128,255,255,64,244,0,0,244,0,0,244,0,0,244,0,0,244,0,0,255,255,192,255,255,192, - // 0x00ca Ê + // 0x00ca Ê 9,21,63,12,2,0,2,240,0,11,252,0,30,31,0,36,6,64,0,0,0,170,170,128,255,255,192,249,85,64,244,0,0,244,0,0,244,0,0,248,0,0,255,255,128,255,255,64,244,0,0,244,0,0,244,0,0,244,0,0,244,0,0,255,255,192,255,255,192, - // 0x00cb Ë + // 0x00cb Ë 9,20,60,12,2,0,30,31,0,30,15,0,0,0,0,0,0,0,170,170,128,255,255,192,249,85,64,244,0,0,244,0,0,244,0,0,248,0,0,255,255,128,255,255,64,244,0,0,244,0,0,244,0,0,244,0,0,244,0,0,255,255,192,255,255,192, - // 0x00cc ÃŒ + // 0x00cc Ì 6,21,42,8,1,0,248,0,125,0,31,0,2,64,0,0,170,160,255,240,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,191,208,255,240, - // 0x00cd Í + // 0x00cd Í 7,21,42,8,1,0,1,244,3,224,11,128,9,0,0,0,170,160,255,240,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,191,208,255,240, - // 0x00ce ÃŽ + // 0x00ce Î 8,21,42,8,0,0,11,208,31,240,124,124,160,10,0,0,42,168,63,252,7,192,7,192,7,192,7,192,7,192,7,192,7,192,7,192,7,192,7,192,7,192,7,192,47,244,63,252, - // 0x00cf Ï + // 0x00cf Ï 6,20,40,8,1,0,240,240,240,240,0,0,0,0,170,160,255,240,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,31,0,191,208,255,240, - // 0x00d0 Ð + // 0x00d0 Ð 15,16,64,16,0,0,10,170,144,0,15,255,254,0,15,149,127,192,15,128,7,224,15,128,2,240,15,128,0,244,15,128,0,248,127,255,0,188,127,255,0,188,31,149,0,248,15,128,0,248,15,128,1,240,15,128,7,224,15,128,111,192,15,255,255,0,15,255,228,0, - // 0x00d1 Ñ + // 0x00d1 Ñ 13,20,80,17,2,0,2,253,56,0,7,175,240,0,6,2,128,0,0,0,0,0,168,0,2,128,254,0,3,192,255,64,3,192,255,192,3,192,247,224,3,192,241,240,3,192,240,252,3,192,240,61,3,192,244,47,3,192,244,15,131,192,244,7,211,192,244,2,243,192,244,0,251,192,244,0,127,192,244,0,63,192,244,0,15,192, - // 0x00d2 Ã’ + // 0x00d2 Ò 15,22,88,17,1,255,0,125,0,0,0,47,0,0,0,11,128,0,0,1,128,0,0,0,0,0,0,111,228,0,3,255,255,64,15,224,31,208,47,0,3,240,62,0,1,244,124,0,0,248,188,0,0,188,188,0,0,188,188,0,0,188,188,0,0,188,124,0,0,248,61,0,0,244,63,0,2,240,15,192,11,208,7,255,255,128,0,191,249,0,0,0,0,0, - // 0x00d3 Ó + // 0x00d3 Ó 15,22,88,17,1,255,0,0,188,0,0,1,244,0,0,3,208,0,0,6,0,0,0,0,0,0,0,111,228,0,3,255,255,64,15,224,31,208,47,0,3,240,62,0,1,244,124,0,0,248,188,0,0,188,188,0,0,188,188,0,0,188,188,0,0,188,124,0,0,248,61,0,0,244,63,0,2,240,15,192,11,208,7,255,255,128,0,191,249,0,0,0,0,0, - // 0x00d4 Ô + // 0x00d4 Ô 15,22,88,17,1,255,0,15,192,0,0,47,240,0,0,184,184,0,0,144,25,0,0,0,0,0,0,111,228,0,3,255,255,64,15,224,31,208,47,0,3,240,62,0,1,244,124,0,0,248,188,0,0,188,188,0,0,188,188,0,0,188,188,0,0,188,124,0,0,248,61,0,0,244,63,0,2,240,15,192,11,208,7,255,255,128,0,191,249,0,0,0,0,0, - // 0x00d5 Õ + // 0x00d5 Õ 15,21,84,17,1,255,0,191,78,0,0,235,252,0,1,128,96,0,0,0,0,0,0,111,228,0,3,255,255,64,15,224,31,208,47,0,3,240,62,0,1,244,124,0,0,248,188,0,0,188,188,0,0,188,188,0,0,188,188,0,0,188,124,0,0,248,61,0,0,244,63,0,2,240,15,192,11,208,7,255,255,128,0,191,249,0,0,0,0,0, - // 0x00d6 Ö + // 0x00d6 Ö 15,21,84,17,1,255,0,120,124,0,0,120,124,0,0,0,0,0,0,0,0,0,0,111,228,0,3,255,255,64,15,224,31,208,47,0,3,240,62,0,1,244,124,0,0,248,188,0,0,188,188,0,0,188,188,0,0,188,188,0,0,188,124,0,0,248,61,0,0,244,63,0,2,240,15,192,11,208,7,255,255,128,0,191,249,0,0,0,0,0, - // 0x00d7 × + // 0x00d7 × 10,11,33,13,1,2,16,0,64,124,1,240,47,7,208,11,223,64,2,253,0,1,252,0,7,255,0,31,75,128,61,2,224,52,0,144,0,0,0, - // 0x00d8 Ø + // 0x00d8 Ø 15,17,68,17,1,255,0,111,228,224,3,255,255,208,15,224,31,192,47,0,15,240,62,0,61,244,124,0,180,248,188,1,240,188,188,3,192,188,188,11,64,188,188,30,0,188,124,60,0,248,61,244,0,244,63,224,2,240,15,208,11,208,15,255,255,128,46,191,249,0,8,0,0,0, - // 0x00d9 Ù + // 0x00d9 Ù 13,22,88,16,2,255,2,224,0,0,0,244,0,0,0,60,0,0,0,10,0,0,0,0,0,0,160,0,10,0,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,0,188,0,47,0,126,0,125,0,47,255,248,0,7,255,208,0,0,0,0,0, - // 0x00da Ú + // 0x00da Ú 13,22,88,16,2,255,0,3,224,0,0,15,128,0,0,30,0,0,0,40,0,0,0,0,0,0,160,0,10,0,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,0,188,0,47,0,126,0,125,0,47,255,248,0,7,255,208,0,0,0,0,0, - // 0x00db Û + // 0x00db Û 13,22,88,16,2,255,0,126,0,0,0,255,64,0,3,211,208,0,10,0,160,0,0,0,0,0,160,0,10,0,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,0,188,0,47,0,126,0,125,0,47,255,248,0,7,255,208,0,0,0,0,0, - // 0x00dc Ãœ + // 0x00dc Ü 13,21,84,16,2,255,3,195,192,0,3,195,192,0,0,0,0,0,0,0,0,0,160,0,10,0,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,64,244,0,15,0,188,0,47,0,126,0,125,0,47,255,248,0,7,255,208,0,0,0,0,0, - // 0x00dd Ý + // 0x00dd Ý 13,21,84,13,0,0,0,3,224,0,0,7,192,0,0,15,0,0,0,40,0,0,0,0,0,0,168,0,10,64,124,0,31,0,62,0,62,0,31,64,124,0,11,192,248,0,3,209,240,0,2,243,208,0,0,255,192,0,0,191,64,0,0,63,0,0,0,62,0,0,0,62,0,0,0,62,0,0,0,62,0,0,0,62,0,0,0,62,0,0, - // 0x00de Þ + // 0x00de Þ 11,16,48,13,2,0,164,0,0,244,0,0,248,0,0,255,254,0,255,255,208,244,7,240,244,1,244,244,0,244,244,0,244,244,2,240,249,95,224,255,255,128,254,164,0,244,0,0,244,0,0,244,0,0, - // 0x00df ß + // 0x00df ß 12,18,54,14,2,255,6,249,0,63,255,192,253,7,240,244,1,240,240,2,240,240,7,208,240,47,64,240,60,0,240,124,0,240,63,64,240,15,224,240,1,252,240,0,125,240,0,61,240,0,61,240,250,252,240,191,224,0,0,0, - // 0x00e0 à + // 0x00e0 à 10,18,54,13,1,255,11,192,0,3,224,0,0,244,0,0,40,0,0,0,0,11,255,64,47,255,192,4,3,224,0,2,240,0,2,240,11,255,240,127,150,240,252,1,240,244,2,240,248,7,240,191,190,240,47,244,240,0,0,0, - // 0x00e1 á + // 0x00e1 á 10,18,54,13,1,255,0,15,128,0,47,0,0,124,0,0,160,0,0,0,0,11,255,64,47,255,192,4,3,224,0,2,240,0,2,240,11,255,240,127,150,240,252,1,240,244,2,240,248,7,240,191,190,240,47,244,240,0,0,0, - // 0x00e2 â + // 0x00e2 â 10,18,54,13,1,255,0,248,0,3,254,0,15,79,64,25,1,128,0,0,0,11,255,64,47,255,192,4,3,224,0,2,240,0,2,240,11,255,240,127,150,240,252,1,240,244,2,240,248,7,240,191,190,240,47,244,240,0,0,0, - // 0x00e3 ã + // 0x00e3 ã 10,17,51,13,1,255,15,224,208,45,191,192,36,10,0,0,0,0,11,255,64,47,255,192,4,3,224,0,2,240,0,2,240,11,255,240,127,150,240,252,1,240,244,2,240,248,7,240,191,190,240,47,244,240,0,0,0, - // 0x00e4 ä + // 0x00e4 ä 10,17,51,13,1,255,15,75,64,15,75,64,0,0,0,0,0,0,11,255,64,47,255,192,4,3,224,0,2,240,0,2,240,11,255,240,127,150,240,252,1,240,244,2,240,248,7,240,191,190,240,47,244,240,0,0,0, - // 0x00e5 Ã¥ + // 0x00e5 å 10,19,57,13,1,255,1,252,0,3,78,0,3,10,0,3,237,0,0,164,0,0,0,0,11,255,64,47,255,192,4,3,224,0,2,240,0,2,240,11,255,240,127,150,240,252,1,240,244,2,240,248,7,240,191,190,240,47,244,240,0,0,0, - // 0x00e6 æ + // 0x00e6 æ 18,13,65,19,1,255,27,254,11,248,0,47,255,191,255,0,4,3,248,15,128,0,3,240,7,192,0,3,240,7,192,11,255,255,255,208,127,87,250,170,128,252,3,240,0,0,244,3,240,0,0,248,11,248,0,64,190,190,63,175,128,47,248,11,255,64,0,0,0,0,0, - // 0x00e7 ç + // 0x00e7 ç 9,18,54,11,1,250,2,255,128,31,255,128,63,0,0,124,0,0,184,0,0,248,0,0,248,0,0,248,0,0,188,0,0,62,0,64,47,255,192,7,255,128,0,176,0,0,248,0,0,45,0,0,45,0,3,252,0,0,64,0, - // 0x00e8 è + // 0x00e8 è 11,18,54,13,1,255,11,192,0,3,224,0,0,244,0,0,40,0,0,0,0,2,254,0,31,255,208,62,2,240,124,0,244,184,0,244,255,255,244,254,170,164,184,0,0,124,0,0,62,0,16,31,251,240,3,255,224,0,0,0, - // 0x00e9 é + // 0x00e9 é 11,18,54,13,1,255,0,15,128,0,47,0,0,124,0,0,160,0,0,0,0,2,254,0,31,255,208,62,2,240,124,0,244,184,0,244,255,255,244,254,170,164,184,0,0,124,0,0,62,0,16,31,251,240,3,255,224,0,0,0, - // 0x00ea ê + // 0x00ea ê 11,18,54,13,1,255,0,248,0,3,254,0,15,75,64,25,1,128,0,0,0,2,254,0,31,255,208,62,2,240,124,0,244,184,0,244,255,255,244,254,170,164,184,0,0,124,0,0,62,0,16,31,251,240,3,255,224,0,0,0, - // 0x00eb ë + // 0x00eb ë 11,17,51,13,1,255,15,75,64,15,75,64,0,0,0,0,0,0,2,254,0,31,255,208,62,2,240,124,0,244,184,0,244,255,255,244,254,170,164,184,0,0,124,0,0,62,0,16,31,251,240,3,255,224,0,0,0, - // 0x00ec ì + // 0x00ec ì 5,17,34,6,0,0,248,0,61,0,15,0,2,64,0,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0, - // 0x00ed í + // 0x00ed í 5,17,34,6,2,0,31,64,62,0,184,0,144,0,0,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0, - // 0x00ee î + // 0x00ee î 8,17,34,6,255,0,11,208,31,240,60,60,160,10,0,0,3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192, - // 0x00ef ï + // 0x00ef ï 6,16,32,6,0,0,240,240,240,240,0,0,0,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0, - // 0x00f0 ð + // 0x00f0 ð 11,18,54,13,1,255,1,64,64,3,247,224,0,191,64,1,255,128,3,199,208,0,1,240,0,84,244,15,255,248,63,151,252,124,0,188,184,0,124,248,0,60,248,0,60,188,0,124,61,0,248,47,235,240,7,255,128,0,0,0, - // 0x00f1 ñ + // 0x00f1 ñ 10,17,51,14,2,0,0,0,64,31,210,192,62,255,64,32,25,0,0,0,0,225,255,64,251,255,208,253,3,240,248,1,240,244,0,240,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240,240,0,240, - // 0x00f2 ò + // 0x00f2 ò 11,18,54,13,1,255,7,208,0,1,240,0,0,124,0,0,25,0,0,0,0,2,255,64,31,255,224,62,1,244,124,0,188,184,0,124,248,0,60,248,0,60,184,0,124,124,0,188,62,0,248,31,239,240,7,255,128,0,0,0, - // 0x00f3 ó + // 0x00f3 ó 11,18,54,13,1,255,0,11,192,0,15,64,0,61,0,0,96,0,0,0,0,2,255,64,31,255,224,62,1,244,124,0,188,184,0,124,248,0,60,248,0,60,184,0,124,124,0,188,62,0,248,31,239,240,7,255,128,0,0,0, - // 0x00f4 ô + // 0x00f4 ô 11,18,54,13,1,255,0,188,0,2,255,0,7,199,192,9,1,144,0,0,0,2,255,64,31,255,224,62,1,244,124,0,188,184,0,124,248,0,60,248,0,60,184,0,124,124,0,188,62,0,248,31,239,240,7,255,128,0,0,0, - // 0x00f5 õ + // 0x00f5 õ 11,17,51,13,1,255,11,244,224,14,191,208,24,6,64,0,0,0,2,255,64,31,255,224,62,1,244,124,0,188,184,0,124,248,0,60,248,0,60,184,0,124,124,0,188,62,0,248,31,239,240,7,255,128,0,0,0, - // 0x00f6 ö + // 0x00f6 ö 11,17,51,13,1,255,7,131,192,7,131,192,0,0,0,0,0,0,2,255,64,31,255,224,62,1,244,124,0,188,184,0,124,248,0,60,248,0,60,184,0,124,124,0,188,62,0,248,31,239,240,7,255,128,0,0,0, - // 0x00f7 ÷ + // 0x00f7 ÷ 11,11,33,13,1,2,0,176,0,0,248,0,0,176,0,0,0,0,170,170,164,255,255,248,0,0,0,0,16,0,0,244,0,0,244,0,0,16,0, - // 0x00f8 ø + // 0x00f8 ø 11,13,39,13,1,255,2,255,180,31,255,240,62,3,244,124,7,252,184,15,124,248,60,60,248,180,60,185,240,124,127,192,188,63,64,248,47,239,240,63,255,128,20,0,0, - // 0x00f9 ù + // 0x00f9 ù 11,18,54,14,1,255,3,224,0,1,244,0,0,124,0,0,9,0,0,0,0,60,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,60,0,188,62,1,252,47,239,252,11,254,60,0,0,0, - // 0x00fa ú + // 0x00fa ú 11,18,54,14,1,255,0,7,208,0,15,128,0,46,0,0,36,0,0,0,0,60,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,60,0,188,62,1,252,47,239,252,11,254,60,0,0,0, - // 0x00fb û + // 0x00fb û 11,18,54,14,1,255,0,189,0,1,255,0,7,199,192,10,0,160,0,0,0,60,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,60,0,188,62,1,252,47,239,252,11,254,60,0,0,0, - // 0x00fc ü + // 0x00fc ü 11,17,51,14,1,255,3,195,192,3,195,192,0,0,0,0,0,0,60,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,124,0,124,60,0,188,62,1,252,47,239,252,11,254,60,0,0,0, - // 0x00fd ý + // 0x00fd ý 12,23,69,12,0,250,0,7,192,0,15,64,0,61,0,0,100,0,0,0,0,184,0,61,124,0,124,61,0,184,47,0,244,15,1,240,15,67,224,7,195,192,3,199,192,2,239,64,0,255,0,0,254,0,0,125,0,0,124,0,0,248,0,1,240,0,111,208,0,191,64,0,16,0,0, - // 0x00fe þ + // 0x00fe þ 11,23,69,14,2,250,160,0,0,240,0,0,240,0,0,240,0,0,240,0,0,241,254,0,251,255,192,253,3,240,248,1,240,244,0,244,240,0,244,240,0,244,244,0,244,248,1,240,252,3,240,255,239,208,242,255,64,240,0,0,240,0,0,240,0,0,240,0,0,240,0,0,80,0,0, - // 0x00ff ÿ + // 0x00ff ÿ 12,22,66,12,0,250,7,131,192,7,131,192,0,0,0,0,0,0,184,0,61,124,0,124,61,0,184,47,0,244,15,1,240,15,67,224,7,195,192,3,199,192,2,239,64,0,255,0,0,254,0,0,125,0,0,124,0,0,248,0,1,240,0,111,208,0,191,64,0,16,0,0, }; diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp index a94b6d28f1d82..c04f1c6d2d77f 100644 --- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp +++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp @@ -223,195 +223,195 @@ extern const uint8_t NotoSans_Medium_19[13901] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0x00a0 " " 0,0,0,7,0,0, - // 0x00a1 ¡ + // 0x00a1 ¡ 4,19,19,7,2,251,252,253,252,36,0,16,120,184,184,184,188,188,252,252,252,252,252,252,168, - // 0x00a2 ¢ + // 0x00a2 ¢ 11,20,60,15,2,255,0,44,0,0,45,0,0,127,144,7,255,248,31,250,240,63,64,0,126,0,0,188,0,0,188,0,0,252,0,0,252,0,0,188,0,0,126,0,0,63,64,0,47,250,244,11,255,244,0,127,144,0,44,0,0,44,0,0,4,0, - // 0x00a3 £ + // 0x00a3 £ 13,19,76,15,1,0,0,27,228,0,0,255,255,0,3,254,175,0,7,224,0,0,11,208,0,0,11,192,0,0,11,192,0,0,11,192,0,0,95,213,80,0,255,255,244,0,175,234,160,0,11,192,0,0,11,192,0,0,11,192,0,0,15,192,0,0,31,64,0,0,191,85,85,64,255,255,255,192,255,255,255,192, - // 0x00a4 ¤ + // 0x00a4 ¤ 11,12,36,15,2,3,160,0,36,251,254,188,127,239,240,61,2,240,120,0,244,180,0,180,180,0,180,124,0,240,63,71,240,191,255,248,245,185,124,64,0,16, - // 0x00a5 Â¥ + // 0x00a5 ¥ 14,19,76,15,0,0,104,0,1,160,62,0,3,240,47,0,7,208,15,128,15,192,11,192,31,64,3,224,63,0,2,240,125,0,0,248,252,0,0,189,244,0,0,63,224,0,11,255,255,64,11,255,255,64,0,15,128,0,0,15,128,0,11,255,255,64,7,255,255,64,0,15,128,0,0,15,128,0,0,15,128,0, - // 0x00a6 ¦ + // 0x00a6 ¦ 2,27,27,14,6,249,160,240,240,240,240,240,240,240,240,240,80,0,0,0,0,0,240,240,240,240,240,240,240,240,240,240,0, - // 0x00a7 § + // 0x00a7 § 11,21,63,13,1,255,2,255,128,31,255,240,62,1,160,60,0,0,62,0,0,47,208,0,11,254,0,31,191,208,60,3,240,124,0,244,61,0,180,63,64,244,15,251,224,1,255,192,0,27,240,0,1,244,0,0,244,80,1,244,191,255,224,47,255,64,0,0,0, - // 0x00a8 ¨ + // 0x00a8 ¨ 8,3,6,15,4,16,244,61,244,61,96,24, - // 0x00a9 © + // 0x00a9 © 20,20,100,22,1,255,0,6,190,64,0,0,127,171,248,0,2,244,0,47,0,11,128,0,3,192,30,1,255,128,240,60,11,235,192,116,52,15,0,0,60,112,46,0,0,44,176,61,0,0,28,176,60,0,0,29,176,60,0,0,29,176,61,0,0,28,116,30,0,0,44,56,15,129,128,56,45,3,255,192,176,15,0,105,2,224,3,208,0,11,128,0,254,69,190,0,0,27,255,224,0,0,0,0,0,0, - // 0x00aa ª + // 0x00aa ª 7,10,20,9,1,9,26,144,191,248,0,60,0,108,127,252,244,44,224,60,245,252,127,156,0,0, - // 0x00ab « + // 0x00ab « 12,12,36,14,1,1,0,64,0,1,240,46,3,224,189,15,193,244,63,7,224,189,15,192,188,15,128,63,7,224,15,194,244,7,224,188,1,240,62,0,64,4, - // 0x00ac ¬ + // 0x00ac ¬ 13,7,28,15,1,3,255,255,255,128,191,255,255,128,0,0,11,128,0,0,11,128,0,0,11,128,0,0,11,128,0,0,6,64, - // 0x00ad ­ + // 0x00ad ­ 7,3,6,8,1,5,255,244,255,244,0,0, - // 0x00ae ® + // 0x00ae ® 20,20,100,22,1,255,0,6,190,64,0,0,127,171,248,0,2,244,0,47,0,11,128,0,3,192,30,11,254,64,240,60,15,239,192,116,52,15,2,224,60,112,15,1,224,44,176,15,2,208,28,176,15,239,192,29,176,15,255,0,29,176,15,15,64,28,116,15,7,192,44,56,15,2,224,56,45,15,0,240,176,15,5,0,82,224,3,208,0,11,128,0,254,69,190,0,0,27,255,224,0,0,0,0,0,0, - // 0x00af ¯ + // 0x00af ¯ 13,3,12,13,0,19,170,170,170,128,255,255,255,192,0,0,0,0, - // 0x00b0 ° + // 0x00b0 ° 9,9,27,11,1,10,6,228,0,47,254,0,124,15,64,180,7,128,180,3,192,184,7,128,62,111,0,31,253,0,1,80,0, - // 0x00b1 ± + // 0x00b1 ± 13,16,64,15,1,0,0,29,0,0,0,45,0,0,0,45,0,0,0,45,0,0,0,45,0,0,106,190,170,64,255,255,255,128,106,191,170,64,0,45,0,0,0,45,0,0,0,45,0,0,0,45,0,0,0,45,0,0,0,0,0,0,255,255,255,128,255,255,255,128, - // 0x00b2 ² + // 0x00b2 ² 8,12,24,9,0,10,31,248,63,191,20,15,0,15,0,31,0,124,1,244,7,208,31,64,63,170,127,255,0,0, - // 0x00b3 ³ + // 0x00b3 ³ 9,12,36,9,0,10,31,248,0,62,191,0,0,15,0,0,15,0,5,125,0,15,248,0,1,111,0,0,15,64,0,15,64,121,111,0,127,253,0,1,64,0, - // 0x00b4 ´ + // 0x00b4 ´ 6,5,10,8,1,15,11,224,15,192,63,0,184,0,0,0, - // 0x00b5 µ + // 0x00b5 µ 13,21,84,16,2,249,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,47,64,252,0,47,64,253,0,63,64,255,65,255,64,255,255,223,64,254,255,79,64,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,0,0,0,0, - // 0x00b6 ¶ + // 0x00b6 ¶ 14,24,96,17,1,252,1,175,255,208,11,255,255,208,47,255,208,208,63,255,208,208,127,255,208,208,191,255,208,208,191,255,208,208,191,255,208,208,127,255,208,208,63,255,208,208,63,255,208,208,31,255,208,208,2,255,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,1,208,208,0,0,64,64, - // 0x00b7 · + // 0x00b7 · 4,5,5,7,2,7,16,252,253,252,16, - // 0x00b8 ¸ + // 0x00b8 ¸ 6,7,14,6,0,249,14,0,47,0,27,192,3,208,91,192,255,64,0,0, - // 0x00b9 ¹ + // 0x00b9 ¹ 6,12,24,9,1,10,3,224,31,224,190,224,98,224,2,224,2,224,2,224,2,224,2,224,2,224,2,224,0,0, - // 0x00ba º + // 0x00ba º 8,10,20,10,1,9,10,144,63,252,244,46,240,15,224,15,240,15,240,15,125,189,31,244,0,0, - // 0x00bb » + // 0x00bb » 12,12,36,14,1,1,0,1,0,188,15,64,126,11,192,31,67,240,11,208,252,3,240,126,2,240,63,11,208,252,31,131,240,62,11,208,188,15,64,16,1,0, - // 0x00bc ¼ + // 0x00bc ¼ 19,19,95,20,1,0,2,128,0,25,0,31,208,0,60,0,191,208,0,184,0,243,208,1,240,0,3,208,3,208,0,3,208,7,192,0,3,208,15,0,0,3,208,46,0,0,3,208,124,11,192,3,208,244,15,192,3,209,240,63,192,1,131,192,183,192,0,11,129,227,192,0,15,3,195,192,0,61,11,67,208,0,124,15,255,252,0,244,10,171,232,2,224,0,3,192,3,192,0,3,192, - // 0x00bd ½ + // 0x00bd ½ 19,19,95,21,1,0,2,128,0,40,0,31,192,0,184,0,191,192,0,240,0,227,192,3,208,0,3,192,7,192,0,3,192,15,0,0,3,192,46,0,0,3,192,60,5,0,3,192,244,191,224,3,193,241,246,244,3,195,208,64,184,2,139,128,0,184,0,15,0,0,240,0,61,0,3,224,0,124,0,15,128,0,244,0,62,0,2,224,0,248,0,3,192,3,255,248,11,128,3,255,252, - // 0x00be ¾ + // 0x00be ¾ 21,19,114,21,0,0,6,228,0,1,144,0,63,254,0,3,208,0,36,31,0,11,128,0,0,15,0,15,0,0,0,47,0,61,0,0,11,248,0,124,0,0,6,190,0,244,0,0,0,15,66,224,0,0,0,11,131,192,188,0,96,15,79,129,252,0,127,254,31,3,252,0,26,164,61,15,124,0,0,0,184,29,124,0,0,0,240,56,124,0,0,2,224,240,124,0,0,7,193,255,255,128,0,15,64,170,254,64,0,46,0,0,124,0,0,60,0,0,124,0, - // 0x00bf ¿ + // 0x00bf ¿ 11,19,57,12,0,251,0,47,0,0,63,128,0,63,64,0,5,0,0,0,0,0,5,0,0,31,0,0,47,0,0,62,0,1,252,0,7,240,0,31,192,0,63,0,0,61,0,0,125,0,0,62,0,0,63,149,188,15,255,252,2,255,144, - // 0x00c0 À + // 0x00c0 À 17,25,125,17,0,0,0,63,0,0,0,0,31,192,0,0,0,7,208,0,0,0,1,240,0,0,0,0,16,0,0,0,0,0,0,0,0,2,160,0,0,0,7,244,0,0,0,15,252,0,0,0,15,188,0,0,0,47,62,0,0,0,62,47,0,0,0,125,31,64,0,0,188,15,128,0,0,248,11,192,0,1,244,7,208,0,3,240,3,240,0,3,255,255,240,0,11,255,255,248,0,15,234,170,252,0,31,128,0,189,0,47,0,0,126,0,63,0,0,63,0,125,0,0,47,64,252,0,0,15,192, - // 0x00c1 Á + // 0x00c1 Á 17,25,125,17,0,0,0,0,47,128,0,0,0,126,0,0,0,0,248,0,0,0,2,224,0,0,0,1,0,0,0,0,0,0,0,0,0,2,160,0,0,0,7,244,0,0,0,15,252,0,0,0,15,188,0,0,0,47,62,0,0,0,62,47,0,0,0,125,31,64,0,0,188,15,128,0,0,248,11,192,0,1,244,7,208,0,3,240,3,240,0,3,255,255,240,0,11,255,255,248,0,15,234,170,252,0,31,128,0,189,0,47,0,0,126,0,63,0,0,63,0,125,0,0,47,64,252,0,0,15,192, - // 0x00c2  + // 0x00c2  17,25,125,17,0,0,0,7,240,0,0,0,15,252,0,0,0,63,63,0,0,0,248,11,128,0,0,64,0,64,0,0,0,0,0,0,0,2,160,0,0,0,7,244,0,0,0,15,252,0,0,0,15,188,0,0,0,47,62,0,0,0,62,47,0,0,0,125,31,64,0,0,188,15,128,0,0,248,11,192,0,1,244,7,208,0,3,240,3,240,0,3,255,255,240,0,11,255,255,248,0,15,234,170,252,0,31,128,0,189,0,47,0,0,126,0,63,0,0,63,0,125,0,0,47,64,252,0,0,15,192, - // 0x00c3 à + // 0x00c3 à 17,25,125,17,0,0,0,0,0,64,0,0,127,129,192,0,0,255,255,192,0,1,208,191,0,0,0,64,0,0,0,0,0,0,0,0,0,2,160,0,0,0,7,244,0,0,0,15,252,0,0,0,15,188,0,0,0,47,62,0,0,0,62,47,0,0,0,125,31,64,0,0,188,15,128,0,0,248,11,192,0,1,244,7,208,0,3,240,3,240,0,3,255,255,240,0,11,255,255,248,0,15,234,170,252,0,31,128,0,189,0,47,0,0,126,0,63,0,0,63,0,125,0,0,47,64,252,0,0,15,192, - // 0x00c4 Ä + // 0x00c4 Ä 17,24,120,17,0,0,0,60,15,0,0,0,125,31,64,0,0,40,10,0,0,0,0,0,0,0,0,0,0,0,0,0,2,160,0,0,0,7,244,0,0,0,15,252,0,0,0,15,188,0,0,0,47,62,0,0,0,62,47,0,0,0,125,31,64,0,0,188,15,128,0,0,248,11,192,0,1,244,7,208,0,3,240,3,240,0,3,255,255,240,0,11,255,255,248,0,15,234,170,252,0,31,128,0,189,0,47,0,0,126,0,63,0,0,63,0,125,0,0,47,64,252,0,0,15,192, - // 0x00c5 Ã… + // 0x00c5 Å 17,23,115,17,0,0,0,0,64,0,0,0,11,248,0,0,0,29,44,0,0,0,28,13,0,0,0,31,252,0,0,0,15,252,0,0,0,15,252,0,0,0,15,188,0,0,0,47,62,0,0,0,62,47,0,0,0,125,31,64,0,0,188,15,128,0,0,248,11,192,0,1,244,7,208,0,3,240,3,240,0,3,255,255,240,0,11,255,255,248,0,15,234,170,252,0,31,128,0,189,0,47,0,0,126,0,63,0,0,63,0,125,0,0,47,64,252,0,0,15,192, - // 0x00c6 Æ + // 0x00c6 Æ 22,19,114,23,0,0,0,0,106,170,170,160,0,0,255,255,255,240,0,1,255,255,255,224,0,3,240,248,0,0,0,3,224,248,0,0,0,11,192,248,0,0,0,15,128,248,0,0,0,47,0,248,0,0,0,62,0,255,255,208,0,188,0,255,255,208,0,252,0,254,170,128,2,255,255,248,0,0,3,255,255,248,0,0,7,234,170,248,0,0,15,192,0,248,0,0,31,128,0,248,0,0,63,0,0,253,85,80,126,0,0,255,255,240,252,0,0,255,255,240, - // 0x00c7 Ç + // 0x00c7 Ç 15,26,104,16,1,249,0,6,254,64,0,191,255,244,2,255,171,240,11,244,0,80,31,192,0,0,47,64,0,0,63,0,0,0,62,0,0,0,126,0,0,0,126,0,0,0,126,0,0,0,126,0,0,0,63,0,0,0,63,0,0,0,47,128,0,0,15,224,0,0,7,253,5,176,1,255,255,240,0,47,255,224,0,1,240,0,0,3,224,0,0,1,188,0,0,0,61,0,0,5,188,0,0,15,244,0,0,0,0,0, - // 0x00c8 È + // 0x00c8 È 11,25,75,14,2,0,11,224,0,3,240,0,0,252,0,0,46,0,0,0,0,0,0,0,106,170,168,191,255,252,191,255,252,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,191,255,244,191,255,244,190,170,160,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,190,85,84,191,255,252,191,255,252, - // 0x00c9 É + // 0x00c9 É 11,25,75,14,2,0,0,3,240,0,15,192,0,47,0,0,124,0,0,16,0,0,0,0,106,170,168,191,255,252,191,255,252,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,191,255,244,191,255,244,190,170,160,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,190,85,84,191,255,252,191,255,252, - // 0x00ca Ê + // 0x00ca Ê 11,25,75,14,2,0,0,254,0,2,255,64,11,219,208,31,1,240,4,0,16,0,0,0,106,170,168,191,255,252,191,255,252,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,191,255,244,191,255,244,190,170,160,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,190,85,84,191,255,252,191,255,252, - // 0x00cb Ë + // 0x00cb Ë 11,24,72,14,2,0,11,131,208,15,195,224,6,1,128,0,0,0,0,0,0,106,170,168,191,255,252,191,255,252,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,191,255,244,191,255,244,190,170,160,189,0,0,189,0,0,189,0,0,189,0,0,189,0,0,190,85,84,191,255,252,191,255,252, - // 0x00cc ÃŒ + // 0x00cc Ì 7,25,50,9,1,0,253,0,63,0,15,128,3,208,0,64,0,0,170,168,255,252,47,228,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,255,252,255,252, - // 0x00cd Í + // 0x00cd Í 8,25,50,9,1,0,0,190,0,252,3,240,11,128,0,0,0,0,170,168,255,252,47,228,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,255,252,255,252, - // 0x00ce ÃŽ + // 0x00ce Î 9,25,75,9,0,0,3,244,0,15,252,0,63,47,0,184,11,192,64,0,64,0,0,0,42,170,0,63,255,0,11,249,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,63,255,0,63,255,0, - // 0x00cf Ï + // 0x00cf Ï 8,24,48,9,1,0,244,60,244,61,96,40,0,0,0,0,170,168,255,252,47,228,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,255,252,255,252, - // 0x00d0 Ð + // 0x00d0 Ð 18,19,95,19,0,0,2,170,148,0,0,7,255,255,208,0,7,255,255,248,0,7,208,2,254,0,7,208,0,63,64,7,208,0,31,192,7,208,0,15,192,7,208,0,11,208,27,229,64,11,208,127,255,224,7,208,127,255,224,11,208,7,208,0,11,208,7,208,0,15,192,7,208,0,31,192,7,208,0,63,64,7,208,0,255,0,7,229,111,252,0,7,255,255,224,0,7,255,249,0,0, - // 0x00d1 Ñ + // 0x00d1 Ñ 16,25,100,20,2,0,0,0,0,64,0,191,67,192,1,255,255,128,2,193,254,0,0,0,0,0,0,0,0,0,106,0,0,41,191,128,0,62,191,192,0,62,191,240,0,62,191,244,0,62,188,252,0,62,188,190,0,62,188,63,64,62,188,31,192,62,188,11,224,62,188,3,240,62,188,1,252,62,188,0,253,62,188,0,63,62,188,0,47,190,188,0,15,254,188,0,7,254,188,0,2,254,188,0,0,254, - // 0x00d2 Ã’ + // 0x00d2 Ò 18,26,130,20,1,255,0,31,192,0,0,0,11,224,0,0,0,2,240,0,0,0,0,124,0,0,0,0,4,0,0,0,0,0,0,0,0,10,254,64,0,0,191,255,244,0,3,255,171,253,0,15,240,0,127,0,31,192,0,31,128,63,64,0,15,192,63,0,0,11,208,126,0,0,7,224,126,0,0,3,224,126,0,0,3,240,126,0,0,3,240,126,0,0,3,224,63,0,0,7,224,63,0,0,11,208,47,128,0,15,192,15,208,0,63,64,7,249,2,254,0,1,255,255,248,0,0,47,255,208,0,0,0,0,0,0, - // 0x00d3 Ó + // 0x00d3 Ó 18,26,130,20,1,255,0,0,15,208,0,0,0,47,128,0,0,0,62,0,0,0,0,244,0,0,0,0,64,0,0,0,0,0,0,0,0,10,254,64,0,0,191,255,244,0,3,255,171,253,0,15,240,0,127,0,31,192,0,31,128,63,64,0,15,192,63,0,0,11,208,126,0,0,7,224,126,0,0,3,224,126,0,0,3,240,126,0,0,3,240,126,0,0,3,224,63,0,0,7,224,63,0,0,11,208,47,128,0,15,192,15,208,0,63,64,7,249,2,254,0,1,255,255,248,0,0,47,255,208,0,0,0,0,0,0, - // 0x00d4 Ô + // 0x00d4 Ô 18,26,130,20,1,255,0,2,252,0,0,0,7,254,0,0,0,15,159,128,0,0,61,3,224,0,0,16,0,0,0,0,0,0,0,0,0,10,254,64,0,0,191,255,244,0,3,255,171,253,0,15,240,0,127,0,31,192,0,31,128,63,64,0,15,192,63,0,0,11,208,126,0,0,7,224,126,0,0,3,224,126,0,0,3,240,126,0,0,3,240,126,0,0,3,224,63,0,0,7,224,63,0,0,11,208,47,128,0,15,192,15,208,0,63,64,7,249,2,254,0,1,255,255,248,0,0,47,255,208,0,0,0,0,0,0, - // 0x00d5 Õ + // 0x00d5 Õ 18,26,130,20,1,255,0,0,0,16,0,0,31,208,176,0,0,63,255,224,0,0,176,63,192,0,0,0,0,0,0,0,0,0,0,0,0,10,254,64,0,0,191,255,244,0,3,255,171,253,0,15,240,0,127,0,31,192,0,31,128,63,64,0,15,192,63,0,0,11,208,126,0,0,7,224,126,0,0,3,224,126,0,0,3,240,126,0,0,3,240,126,0,0,3,224,63,0,0,7,224,63,0,0,11,208,47,128,0,15,192,15,208,0,63,64,7,249,2,254,0,1,255,255,248,0,0,47,255,208,0,0,0,0,0,0, - // 0x00d6 Ö + // 0x00d6 Ö 18,25,125,20,1,255,0,31,7,192,0,0,47,11,192,0,0,9,2,64,0,0,0,0,0,0,0,0,0,0,0,0,10,254,64,0,0,191,255,244,0,3,255,171,253,0,15,240,0,127,0,31,192,0,31,128,63,64,0,15,192,63,0,0,11,208,126,0,0,7,224,126,0,0,3,224,126,0,0,3,240,126,0,0,3,240,126,0,0,3,224,63,0,0,7,224,63,0,0,11,208,47,128,0,15,192,15,208,0,63,64,7,249,2,254,0,1,255,255,248,0,0,47,255,208,0,0,0,0,0,0, - // 0x00d7 × + // 0x00d7 × 11,12,36,15,2,3,96,0,32,248,0,188,126,2,244,31,139,208,7,255,64,1,253,0,2,254,0,11,239,128,47,71,224,189,1,248,244,0,120,16,0,16, - // 0x00d8 Ø + // 0x00d8 Ø 18,20,100,20,1,255,0,10,254,75,64,0,191,255,255,0,3,255,171,254,0,15,240,0,255,0,31,192,1,255,128,63,64,3,223,192,63,0,15,139,208,126,0,47,7,224,126,0,61,3,240,126,0,248,3,240,126,2,240,3,240,126,7,192,3,224,63,15,64,7,224,63,47,0,11,208,47,252,0,15,192,15,244,0,63,64,7,253,2,254,0,11,255,255,248,0,15,111,255,208,0,6,0,0,0,0, - // 0x00d9 Ù + // 0x00d9 Ù 15,26,104,19,2,255,0,253,0,0,0,63,0,0,0,15,128,0,0,3,208,0,0,0,64,0,0,0,0,0,104,0,0,164,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,126,0,1,248,63,0,3,240,47,208,31,224,11,255,255,128,1,255,253,0,0,0,0,0, - // 0x00da Ú + // 0x00da Ú 15,26,104,19,2,255,0,0,190,0,0,0,252,0,0,3,240,0,0,11,128,0,0,0,0,0,0,0,0,0,104,0,0,164,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,126,0,1,248,63,0,3,240,47,208,31,224,11,255,255,128,1,255,253,0,0,0,0,0, - // 0x00db Û + // 0x00db Û 15,26,104,19,2,255,0,15,208,0,0,63,240,0,0,252,252,0,2,224,47,0,1,0,1,0,0,0,0,0,104,0,0,164,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,126,0,1,248,63,0,3,240,47,208,31,224,11,255,255,128,1,255,253,0,0,0,0,0, - // 0x00dc Ãœ + // 0x00dc Ü 15,25,100,19,2,255,0,244,60,0,0,244,61,0,0,96,40,0,0,0,0,0,0,0,0,0,104,0,0,164,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,188,0,0,252,126,0,1,248,63,0,3,240,47,208,31,224,11,255,255,128,1,255,253,0,0,0,0,0, - // 0x00dd Ý + // 0x00dd Ý 15,25,100,15,0,0,0,0,190,0,0,0,252,0,0,3,240,0,0,11,128,0,0,0,0,0,0,0,0,0,104,0,0,168,126,0,1,248,63,0,3,240,31,128,7,208,15,192,15,192,7,224,47,64,2,240,63,0,0,248,189,0,0,189,252,0,0,63,240,0,0,47,224,0,0,15,192,0,0,15,192,0,0,15,192,0,0,15,192,0,0,15,192,0,0,15,192,0,0,15,192,0,0,15,192,0, - // 0x00de Þ + // 0x00de Þ 13,19,76,16,2,0,104,0,0,0,189,0,0,0,189,0,0,0,190,85,0,0,191,255,244,0,191,255,253,0,189,0,191,0,189,0,47,64,189,0,31,128,189,0,31,128,189,0,31,64,189,0,63,0,189,86,254,0,191,255,248,0,191,255,144,0,189,0,0,0,189,0,0,0,189,0,0,0,189,0,0,0, - // 0x00df ß + // 0x00df ß 14,21,84,17,2,255,1,191,144,0,31,255,252,0,63,149,255,0,189,0,63,0,252,0,47,0,252,0,63,0,252,0,252,0,252,3,240,0,252,15,192,0,252,15,128,0,252,15,208,0,252,7,248,0,252,1,255,0,252,0,47,192,252,0,7,224,252,0,3,240,252,0,3,240,252,36,7,224,252,63,255,192,252,47,255,0,0,0,64,0, - // 0x00e0 à + // 0x00e0 à 12,21,63,15,1,255,3,240,0,1,252,0,0,125,0,0,31,0,0,1,0,0,4,0,7,255,224,15,255,252,10,0,190,0,0,63,0,0,63,0,21,191,11,255,255,63,229,127,190,0,63,252,0,63,252,0,127,190,1,255,63,255,239,31,254,31,0,0,0, - // 0x00e1 á + // 0x00e1 á 12,21,63,15,1,255,0,2,248,0,7,224,0,15,128,0,46,0,0,16,0,0,4,0,7,255,224,15,255,252,10,0,190,0,0,63,0,0,63,0,21,191,11,255,255,63,229,127,190,0,63,252,0,63,252,0,127,190,1,255,63,255,239,31,254,31,0,0,0, - // 0x00e2 â + // 0x00e2 â 12,21,63,15,1,255,0,127,64,0,255,192,3,243,240,15,128,184,4,0,4,0,4,0,7,255,224,15,255,252,10,0,190,0,0,63,0,0,63,0,21,191,11,255,255,63,229,127,190,0,63,252,0,63,252,0,127,190,1,255,63,255,239,31,254,31,0,0,0, - // 0x00e3 ã + // 0x00e3 ã 12,21,63,15,1,255,0,0,4,7,248,28,15,255,252,29,11,240,4,0,0,0,4,0,7,255,224,15,255,252,10,0,190,0,0,63,0,0,63,0,21,191,11,255,255,63,229,127,190,0,63,252,0,63,252,0,127,190,1,255,63,255,239,31,254,31,0,0,0, - // 0x00e4 ä + // 0x00e4 ä 12,20,60,15,1,255,3,192,240,7,209,244,2,128,160,0,0,0,0,4,0,7,255,224,15,255,252,10,0,190,0,0,63,0,0,63,0,21,191,11,255,255,63,229,127,190,0,63,252,0,63,252,0,127,190,1,255,63,255,239,31,254,31,0,0,0, - // 0x00e5 Ã¥ + // 0x00e5 å 12,23,69,15,1,255,0,4,0,0,191,128,1,210,192,1,192,208,1,226,192,0,191,64,0,0,0,0,4,0,7,255,224,15,255,252,10,0,190,0,0,63,0,0,63,0,21,191,11,255,255,63,229,127,190,0,63,252,0,63,252,0,127,190,1,255,63,255,239,31,254,31,0,0,0, - // 0x00e6 æ + // 0x00e6 æ 21,16,96,23,1,255,0,4,0,0,0,0,11,255,208,191,224,0,31,255,251,255,252,0,9,0,255,192,127,0,0,0,127,0,47,0,0,0,63,0,31,64,0,21,191,85,111,128,11,255,255,255,255,128,63,213,127,170,170,64,190,0,62,0,0,0,252,0,127,0,0,0,252,0,191,64,0,0,190,2,255,208,7,0,63,255,195,255,255,0,15,254,0,191,253,0,0,0,0,0,0,0, - // 0x00e7 ç + // 0x00e7 ç 11,21,63,13,1,249,1,255,248,11,255,248,47,208,96,63,0,0,126,0,0,189,0,0,188,0,0,188,0,0,189,0,0,126,0,0,63,0,0,47,208,40,15,255,248,1,255,244,0,46,0,0,62,0,0,31,192,0,3,192,0,91,192,0,255,0,0,0,0, - // 0x00e8 è + // 0x00e8 è 13,21,84,15,1,255,3,240,0,0,1,252,0,0,0,125,0,0,0,31,0,0,0,1,0,0,0,0,0,0,1,255,224,0,11,255,252,0,31,128,126,0,63,0,47,0,125,0,31,64,126,85,111,128,191,255,255,128,190,170,170,64,189,0,0,0,126,0,0,0,63,0,0,0,31,208,6,0,11,255,255,0,1,255,253,0,0,1,0,0, - // 0x00e9 é + // 0x00e9 é 13,21,84,15,1,255,0,2,248,0,0,7,224,0,0,15,128,0,0,46,0,0,0,16,0,0,0,0,0,0,1,255,224,0,11,255,252,0,31,128,126,0,63,0,47,0,125,0,31,64,126,85,111,128,191,255,255,128,190,170,170,64,189,0,0,0,126,0,0,0,63,0,0,0,31,208,6,0,11,255,255,0,1,255,253,0,0,1,0,0, - // 0x00ea ê + // 0x00ea ê 13,21,84,15,1,255,0,127,64,0,0,255,192,0,3,243,240,0,15,128,188,0,4,0,4,0,0,0,0,0,1,255,224,0,11,255,252,0,31,128,126,0,63,0,47,0,125,0,31,64,126,85,111,128,191,255,255,128,190,170,170,64,189,0,0,0,126,0,0,0,63,0,0,0,31,208,6,0,11,255,255,0,1,255,253,0,0,1,0,0, - // 0x00eb ë + // 0x00eb ë 13,20,80,15,1,255,3,192,240,0,7,209,244,0,2,128,160,0,0,0,0,0,0,0,0,0,1,255,224,0,11,255,252,0,31,128,126,0,63,0,47,0,125,0,31,64,126,85,111,128,191,255,255,128,190,170,170,64,189,0,0,0,126,0,0,0,63,0,0,0,31,208,6,0,11,255,255,0,1,255,253,0,0,1,0,0, - // 0x00ec ì + // 0x00ec ì 6,20,40,7,0,0,252,0,127,0,31,128,3,208,0,64,0,0,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192,15,192, - // 0x00ed í + // 0x00ed í 6,20,40,7,2,0,11,224,15,192,63,0,184,0,0,0,0,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0, - // 0x00ee î + // 0x00ee î 9,20,60,7,255,0,7,244,0,15,252,0,63,63,0,184,11,192,64,0,64,0,0,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0, - // 0x00ef ï + // 0x00ef ï 9,19,57,7,255,0,60,15,0,125,31,64,40,10,0,0,0,0,0,0,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0,3,240,0, - // 0x00f0 ð + // 0x00f0 ð 14,21,84,16,1,255,0,80,8,0,0,253,126,0,0,127,248,0,0,47,240,0,1,254,248,0,1,224,189,0,0,0,63,0,0,21,15,64,3,255,239,192,15,255,255,192,63,64,47,208,126,0,15,208,189,0,7,208,188,0,7,208,188,0,7,208,125,0,11,192,63,0,15,192,47,128,63,64,15,255,254,0,1,255,244,0,0,0,0,0, - // 0x00f1 ñ + // 0x00f1 ñ 13,20,80,16,2,0,0,0,4,0,7,244,44,0,15,255,248,0,44,15,240,0,0,0,0,0,0,1,0,0,244,191,244,0,251,255,253,0,255,128,191,0,254,0,63,0,252,0,47,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64,252,0,31,64, - // 0x00f2 ò + // 0x00f2 ò 14,21,84,16,1,255,2,248,0,0,0,252,0,0,0,63,0,0,0,11,128,0,0,0,64,0,0,0,0,0,1,255,244,0,11,255,253,0,47,208,127,64,63,0,15,192,126,0,11,192,189,0,7,208,188,0,7,208,188,0,7,208,125,0,7,208,126,0,11,192,63,0,15,192,31,208,127,64,11,255,254,0,1,255,244,0,0,0,0,0, - // 0x00f3 ó + // 0x00f3 ó 14,21,84,16,1,255,0,0,252,0,0,3,244,0,0,11,208,0,0,31,0,0,0,4,0,0,0,0,0,0,1,255,244,0,11,255,253,0,47,208,127,64,63,0,15,192,126,0,11,192,189,0,7,208,188,0,7,208,188,0,7,208,125,0,7,208,126,0,11,192,63,0,15,192,31,208,127,64,11,255,254,0,1,255,244,0,0,0,0,0, - // 0x00f4 ô + // 0x00f4 ô 14,21,84,16,1,255,0,63,128,0,0,191,208,0,1,246,244,0,7,192,125,0,1,0,4,0,0,0,0,0,1,255,244,0,11,255,253,0,47,208,127,64,63,0,15,192,126,0,11,192,189,0,7,208,188,0,7,208,188,0,7,208,125,0,7,208,126,0,11,192,63,0,15,192,31,208,127,64,11,255,254,0,1,255,244,0,0,0,0,0, - // 0x00f5 õ + // 0x00f5 õ 14,20,80,16,1,255,2,253,14,0,11,255,253,0,15,7,248,0,0,0,0,0,0,0,0,0,1,255,244,0,11,255,253,0,47,208,127,64,63,0,15,192,126,0,11,192,189,0,7,208,188,0,7,208,188,0,7,208,125,0,7,208,126,0,11,192,63,0,15,192,31,208,127,64,11,255,254,0,1,255,244,0,0,0,0,0, - // 0x00f6 ö + // 0x00f6 ö 14,20,80,16,1,255,2,224,184,0,3,240,248,0,1,128,96,0,0,0,0,0,0,0,0,0,1,255,244,0,11,255,253,0,47,208,127,64,63,0,15,192,126,0,11,192,189,0,7,208,188,0,7,208,188,0,7,208,125,0,7,208,126,0,11,192,63,0,15,192,31,208,127,64,11,255,254,0,1,255,244,0,0,0,0,0, - // 0x00f7 ÷ + // 0x00f7 ÷ 13,12,48,15,1,3,0,62,0,0,0,63,0,0,0,62,0,0,0,0,0,0,0,0,0,0,255,255,255,128,191,255,255,128,0,0,0,0,0,4,0,0,0,63,0,0,0,63,0,0,0,45,0,0, - // 0x00f8 ø + // 0x00f8 ø 14,16,64,16,1,255,0,0,1,0,1,255,235,128,11,255,255,0,47,208,127,64,63,0,255,192,126,1,255,192,189,3,215,208,188,15,135,208,188,47,7,208,189,124,7,208,126,244,11,192,63,224,15,192,31,208,127,64,15,255,254,0,46,255,244,0,8,0,0,0, - // 0x00f9 ù + // 0x00f9 ù 12,21,63,16,2,255,7,240,0,2,244,0,0,188,0,0,31,0,0,1,0,0,0,0,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,63,252,0,127,191,1,255,63,255,239,15,255,15,0,0,0, - // 0x00fa ú + // 0x00fa ú 12,21,63,16,2,255,0,3,244,0,11,208,0,31,64,0,61,0,0,16,0,0,0,0,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,63,252,0,127,191,1,255,63,255,239,15,255,15,0,0,0, - // 0x00fb û + // 0x00fb û 12,21,63,16,2,255,0,191,0,1,255,128,3,231,224,15,64,244,4,0,16,0,0,0,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,63,252,0,127,191,1,255,63,255,239,15,255,15,0,0,0, - // 0x00fc ü + // 0x00fc ü 12,20,60,16,2,255,7,193,240,11,194,240,2,64,144,0,0,0,0,0,0,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,47,252,0,63,252,0,127,191,1,255,63,255,239,15,255,15,0,0,0, - // 0x00fd ý + // 0x00fd ý 14,27,108,14,0,249,0,1,252,0,0,3,240,0,0,11,192,0,0,31,0,0,0,4,0,0,0,0,0,0,252,0,7,224,126,0,15,192,63,0,15,192,47,64,31,64,15,128,63,0,15,192,62,0,7,208,188,0,3,224,252,0,2,240,244,0,0,246,240,0,0,251,224,0,0,127,208,0,0,63,192,0,0,47,128,0,0,47,0,0,0,63,0,0,0,125,0,0,1,252,0,0,191,240,0,0,191,192,0,0,0,0,0,0, - // 0x00fe þ + // 0x00fe þ 13,27,108,16,2,249,184,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,191,240,0,254,255,252,0,255,64,191,0,254,0,63,0,252,0,31,128,252,0,15,128,252,0,15,128,252,0,15,128,252,0,15,128,252,0,31,128,254,0,63,0,255,128,191,0,255,255,252,0,252,191,224,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,252,0,0,0,0,0,0,0, - // 0x00ff ÿ + // 0x00ff ÿ 14,26,104,14,0,249,3,224,244,0,3,224,248,0,1,128,96,0,0,0,0,0,0,0,0,0,252,0,7,224,126,0,15,192,63,0,15,192,47,64,31,64,15,128,63,0,15,192,62,0,7,208,188,0,3,224,252,0,2,240,244,0,0,246,240,0,0,251,224,0,0,127,208,0,0,63,192,0,0,47,128,0,0,47,0,0,0,63,0,0,0,125,0,0,1,252,0,0,191,240,0,0,191,192,0,0,0,0,0,0, }; diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp index e3d5f1d05672e..d22ee15a5f6e2 100644 --- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp +++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp @@ -223,195 +223,195 @@ extern const uint8_t Unifont_10[3107] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0x00a0 " " 0,0,0,8,0,0, - // 0x00a1 ¡ + // 0x00a1 ¡ 1,10,10,8,4,0,128,128,0,128,128,128,128,128,128,128, - // 0x00a2 ¢ + // 0x00a2 ¢ 7,10,10,8,1,0,16,16,124,146,144,144,146,124,16,16, - // 0x00a3 £ + // 0x00a3 £ 7,10,10,8,1,0,28,32,32,32,248,32,32,32,124,194, - // 0x00a4 ¤ + // 0x00a4 ¤ 6,8,8,8,1,1,132,120,72,132,132,72,120,132, - // 0x00a5 Â¥ + // 0x00a5 ¥ 7,10,10,8,1,0,130,68,40,16,254,16,254,16,16,16, - // 0x00a6 ¦ + // 0x00a6 ¦ 1,10,10,8,4,0,128,128,128,128,0,0,128,128,128,128, - // 0x00a7 § + // 0x00a7 § 6,10,10,8,1,0,120,132,128,120,132,132,120,4,132,120, - // 0x00a8 ¨ + // 0x00a8 ¨ 4,2,2,8,2,12,144,144, - // 0x00a9 © + // 0x00a9 © 8,10,10,8,0,0,60,66,153,165,161,161,165,153,66,60, - // 0x00aa ª + // 0x00aa ª 5,7,7,8,2,5,112,8,120,136,120,0,248, - // 0x00ab « + // 0x00ab « 6,9,9,8,1,0,36,36,72,72,144,72,72,36,36, - // 0x00ac ¬ + // 0x00ac ¬ 6,4,4,8,1,0,252,4,4,4, - // 0x00ad ­ + // 0x00ad ­ 16,16,32,16,0,254,170,170,0,1,128,0,58,99,194,84,51,201,138,72,114,73,128,0,0,1,128,0,3,193,128,0,0,1,128,0,85,85, - // 0x00ae ® + // 0x00ae ® 8,10,10,8,0,0,60,66,185,165,165,185,169,165,66,60, - // 0x00af ¯ + // 0x00af ¯ 6,1,1,8,1,11,252, - // 0x00b0 ° + // 0x00b0 ° 4,4,4,8,2,6,96,144,144,96, - // 0x00b1 ± + // 0x00b1 ± 7,9,9,8,1,1,16,16,16,254,16,16,16,0,254, - // 0x00b2 ² + // 0x00b2 ² 5,7,7,8,1,4,112,136,8,48,64,128,248, - // 0x00b3 ³ + // 0x00b3 ³ 5,7,7,8,1,4,112,136,8,112,8,136,112, - // 0x00b4 ´ + // 0x00b4 ´ 3,3,3,8,3,10,32,64,128, - // 0x00b5 µ + // 0x00b5 µ 8,10,10,8,0,254,66,66,66,66,66,66,102,89,64,128, - // 0x00b6 ¶ + // 0x00b6 ¶ 7,11,11,8,1,255,126,244,244,244,116,20,20,20,20,20,20, - // 0x00b7 · + // 0x00b7 · 2,2,2,8,3,4,192,192, - // 0x00b8 ¸ + // 0x00b8 ¸ 3,2,2,8,2,254,32,192, - // 0x00b9 ¹ + // 0x00b9 ¹ 5,7,7,8,1,4,32,96,160,32,32,32,248, - // 0x00ba º + // 0x00ba º 5,7,7,8,2,5,112,136,136,136,112,0,248, - // 0x00bb » + // 0x00bb » 6,9,9,8,1,0,144,144,72,72,36,72,72,144,144, - // 0x00bc ¼ + // 0x00bc ¼ 6,10,10,8,1,0,68,196,72,80,80,36,44,84,156,132, - // 0x00bd ½ + // 0x00bd ½ 6,10,10,8,1,0,68,196,72,80,80,40,52,68,136,156, - // 0x00be ¾ + // 0x00be ¾ 6,10,10,8,1,0,196,36,72,48,208,36,44,84,156,132, - // 0x00bf ¿ + // 0x00bf ¿ 6,10,10,8,1,0,32,32,0,32,32,64,128,132,132,120, - // 0x00c0 À + // 0x00c0 À 6,14,14,8,1,0,96,24,0,0,48,72,72,132,132,252,132,132,132,132, - // 0x00c1 Á + // 0x00c1 Á 6,14,14,8,1,0,24,96,0,0,48,72,72,132,132,252,132,132,132,132, - // 0x00c2  + // 0x00c2  6,14,14,8,1,0,48,72,0,0,48,72,72,132,132,252,132,132,132,132, - // 0x00c3 à + // 0x00c3 à 6,14,14,8,1,0,100,152,0,0,48,72,72,132,132,252,132,132,132,132, - // 0x00c4 Ä + // 0x00c4 Ä 6,14,14,8,1,0,72,72,0,0,48,72,72,132,132,252,132,132,132,132, - // 0x00c5 Ã… + // 0x00c5 Å 6,14,14,8,1,0,48,72,48,0,48,72,72,132,132,252,132,132,132,132, - // 0x00c6 Æ + // 0x00c6 Æ 7,10,10,8,1,0,62,80,144,144,254,144,144,144,144,158, - // 0x00c7 Ç + // 0x00c7 Ç 6,12,12,8,1,254,120,132,132,128,128,128,128,132,132,120,16,96, - // 0x00c8 È + // 0x00c8 È 6,14,14,8,1,0,96,24,0,0,252,128,128,128,248,128,128,128,128,252, - // 0x00c9 É + // 0x00c9 É 6,14,14,8,1,0,24,96,0,0,252,128,128,128,248,128,128,128,128,252, - // 0x00ca Ê + // 0x00ca Ê 6,14,14,8,1,0,48,72,0,0,252,128,128,128,248,128,128,128,128,252, - // 0x00cb Ë + // 0x00cb Ë 6,14,14,8,1,0,72,72,0,0,252,128,128,128,248,128,128,128,128,252, - // 0x00cc ÃŒ + // 0x00cc Ì 5,14,14,8,2,0,96,24,0,0,248,32,32,32,32,32,32,32,32,248, - // 0x00cd Í + // 0x00cd Í 5,14,14,8,2,0,48,192,0,0,248,32,32,32,32,32,32,32,32,248, - // 0x00ce ÃŽ + // 0x00ce Î 5,14,14,8,2,0,96,144,0,0,248,32,32,32,32,32,32,32,32,248, - // 0x00cf Ï + // 0x00cf Ï 5,14,14,8,2,0,144,144,0,0,248,32,32,32,32,32,32,32,32,248, - // 0x00d0 Ð + // 0x00d0 Ð 7,10,10,8,0,0,120,68,66,66,242,66,66,66,68,120, - // 0x00d1 Ñ + // 0x00d1 Ñ 6,14,14,8,1,0,100,152,0,0,132,196,196,164,164,148,148,140,140,132, - // 0x00d2 Ã’ + // 0x00d2 Ò 6,14,14,8,1,0,96,24,0,0,120,132,132,132,132,132,132,132,132,120, - // 0x00d3 Ó + // 0x00d3 Ó 6,14,14,8,1,0,24,96,0,0,120,132,132,132,132,132,132,132,132,120, - // 0x00d4 Ô + // 0x00d4 Ô 6,14,14,8,1,0,48,72,0,0,120,132,132,132,132,132,132,132,132,120, - // 0x00d5 Õ + // 0x00d5 Õ 6,14,14,8,1,0,100,152,0,0,120,132,132,132,132,132,132,132,132,120, - // 0x00d6 Ö + // 0x00d6 Ö 6,14,14,8,1,0,72,72,0,0,120,132,132,132,132,132,132,132,132,120, - // 0x00d7 × + // 0x00d7 × 6,5,5,8,1,2,132,72,48,72,132, - // 0x00d8 Ø + // 0x00d8 Ø 6,12,12,8,1,255,4,116,136,140,148,148,164,164,196,68,184,128, - // 0x00d9 Ù + // 0x00d9 Ù 6,14,14,8,1,0,96,24,0,0,132,132,132,132,132,132,132,132,132,120, - // 0x00da Ú + // 0x00da Ú 6,14,14,8,1,0,24,96,0,0,132,132,132,132,132,132,132,132,132,120, - // 0x00db Û + // 0x00db Û 6,14,14,8,1,0,48,72,0,0,132,132,132,132,132,132,132,132,132,120, - // 0x00dc Ãœ + // 0x00dc Ü 6,14,14,8,1,0,72,72,0,0,132,132,132,132,132,132,132,132,132,120, - // 0x00dd Ý + // 0x00dd Ý 7,14,14,8,1,0,24,96,0,0,130,130,68,68,40,16,16,16,16,16, - // 0x00de Þ + // 0x00de Þ 6,11,11,8,1,0,128,128,240,136,132,132,136,240,128,128,128, - // 0x00df ß + // 0x00df ß 6,10,10,8,1,0,112,136,136,144,176,136,132,132,164,152, - // 0x00e0 à + // 0x00e0 à 6,12,12,8,1,0,96,24,0,0,120,132,4,124,132,132,140,116, - // 0x00e1 á + // 0x00e1 á 6,12,12,8,1,0,24,96,0,0,120,132,4,124,132,132,140,116, - // 0x00e2 â + // 0x00e2 â 6,12,12,8,1,0,48,72,0,0,120,132,4,124,132,132,140,116, - // 0x00e3 ã + // 0x00e3 ã 6,12,12,8,1,0,100,152,0,0,120,132,4,124,132,132,140,116, - // 0x00e4 ä + // 0x00e4 ä 6,12,12,8,1,0,72,72,0,0,120,132,4,124,132,132,140,116, - // 0x00e5 Ã¥ + // 0x00e5 å 6,13,13,8,1,0,48,72,48,0,0,120,132,4,124,132,132,140,116, - // 0x00e6 æ + // 0x00e6 æ 7,8,8,8,1,0,124,146,18,126,144,144,146,124, - // 0x00e7 ç + // 0x00e7 ç 6,10,10,8,1,254,120,132,128,128,128,128,132,120,16,96, - // 0x00e8 è + // 0x00e8 è 6,12,12,8,1,0,96,24,0,0,120,132,132,252,128,128,132,120, - // 0x00e9 é + // 0x00e9 é 6,12,12,8,1,0,24,96,0,0,120,132,132,252,128,128,132,120, - // 0x00ea ê + // 0x00ea ê 6,12,12,8,1,0,48,72,0,0,120,132,132,252,128,128,132,120, - // 0x00eb ë + // 0x00eb ë 6,12,12,8,1,0,72,72,0,0,120,132,132,252,128,128,132,120, - // 0x00ec ì + // 0x00ec ì 5,12,12,8,2,0,192,48,0,0,96,32,32,32,32,32,32,248, - // 0x00ed í + // 0x00ed í 5,12,12,8,2,0,48,192,0,0,96,32,32,32,32,32,32,248, - // 0x00ee î + // 0x00ee î 5,12,12,8,2,0,96,144,0,0,96,32,32,32,32,32,32,248, - // 0x00ef ï + // 0x00ef ï 5,12,12,8,2,0,144,144,0,0,96,32,32,32,32,32,32,248, - // 0x00f0 ð + // 0x00f0 ð 6,12,12,8,1,0,100,24,40,68,4,124,132,132,132,132,132,120, - // 0x00f1 ñ + // 0x00f1 ñ 6,12,12,8,1,0,100,152,0,0,184,196,132,132,132,132,132,132, - // 0x00f2 ò + // 0x00f2 ò 6,12,12,8,1,0,96,24,0,0,120,132,132,132,132,132,132,120, - // 0x00f3 ó + // 0x00f3 ó 6,12,12,8,1,0,24,96,0,0,120,132,132,132,132,132,132,120, - // 0x00f4 ô + // 0x00f4 ô 6,12,12,8,1,0,48,72,0,0,120,132,132,132,132,132,132,120, - // 0x00f5 õ + // 0x00f5 õ 6,12,12,8,1,0,100,152,0,0,120,132,132,132,132,132,132,120, - // 0x00f6 ö + // 0x00f6 ö 6,12,12,8,1,0,72,72,0,0,120,132,132,132,132,132,132,120, - // 0x00f7 ÷ + // 0x00f7 ÷ 6,7,7,8,1,1,48,0,0,252,0,0,48, - // 0x00f8 ø + // 0x00f8 ø 6,10,10,8,1,255,4,120,140,148,148,164,164,196,120,128, - // 0x00f9 ù + // 0x00f9 ù 6,12,12,8,1,0,96,24,0,0,132,132,132,132,132,132,140,116, - // 0x00fa ú + // 0x00fa ú 6,12,12,8,1,0,24,96,0,0,132,132,132,132,132,132,140,116, - // 0x00fb û + // 0x00fb û 6,12,12,8,1,0,48,72,0,0,132,132,132,132,132,132,140,116, - // 0x00fc ü + // 0x00fc ü 6,12,12,8,1,0,72,72,0,0,132,132,132,132,132,132,140,116, - // 0x00fd ý + // 0x00fd ý 6,14,14,8,1,254,24,96,0,0,132,132,132,132,132,76,52,4,4,120, - // 0x00fe þ + // 0x00fe þ 6,13,13,8,1,254,128,128,128,184,196,132,132,132,132,196,184,128,128, - // 0x00ff ÿ + // 0x00ff ÿ 6,14,14,8,1,254,72,72,0,0,132,132,132,132,132,76,52,4,4,120, }; diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp index 8199058b0893a..9d6847722f446 100644 --- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp +++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp @@ -223,195 +223,195 @@ extern const uint8_t Unifont_20[8545] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0x00a0 " " 0,0,0,16,0,0, - // 0x00a1 ¡ + // 0x00a1 ¡ 2,20,20,16,8,0,192,192,192,192,0,0,192,192,192,192,192,192,192,192,192,192,192,192,192,192, - // 0x00a2 ¢ + // 0x00a2 ¢ 14,20,40,16,2,0,3,0,3,0,3,0,3,0,63,240,63,240,195,12,195,12,195,0,195,0,195,0,195,0,195,12,195,12,63,240,63,240,3,0,3,0,3,0,3,0, - // 0x00a3 £ + // 0x00a3 £ 14,20,40,16,2,0,3,240,3,240,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192,12,0,12,0,12,0,12,0,12,0,12,0,63,240,63,240,240,12,240,12, - // 0x00a4 ¤ + // 0x00a4 ¤ 12,16,32,16,2,2,192,48,192,48,63,192,63,192,48,192,48,192,192,48,192,48,192,48,192,48,48,192,48,192,63,192,63,192,192,48,192,48, - // 0x00a5 Â¥ + // 0x00a5 ¥ 14,20,40,16,2,0,192,12,192,12,48,48,48,48,12,192,12,192,3,0,3,0,255,252,255,252,3,0,3,0,255,252,255,252,3,0,3,0,3,0,3,0,3,0,3,0, - // 0x00a6 ¦ + // 0x00a6 ¦ 2,20,20,16,8,0,192,192,192,192,192,192,192,192,0,0,0,0,192,192,192,192,192,192,192,192, - // 0x00a7 § + // 0x00a7 § 12,20,40,16,2,0,63,192,63,192,192,48,192,48,192,0,192,0,63,192,63,192,192,48,192,48,192,48,192,48,63,192,63,192,0,48,0,48,192,48,192,48,63,192,63,192, - // 0x00a8 ¨ + // 0x00a8 ¨ 8,4,4,16,4,24,195,195,195,195, - // 0x00a9 © + // 0x00a9 © 16,20,40,16,0,0,15,240,15,240,48,12,48,12,195,195,195,195,204,51,204,51,204,3,204,3,204,3,204,3,204,51,204,51,195,195,195,195,48,12,48,12,15,240,15,240, - // 0x00aa ª + // 0x00aa ª 10,14,28,16,4,10,63,0,63,0,0,192,0,192,63,192,63,192,192,192,192,192,63,192,63,192,0,0,0,0,255,192,255,192, - // 0x00ab « + // 0x00ab « 12,18,36,16,2,0,12,48,12,48,12,48,12,48,48,192,48,192,48,192,48,192,195,0,195,0,48,192,48,192,48,192,48,192,12,48,12,48,12,48,12,48, - // 0x00ac ¬ + // 0x00ac ¬ 12,8,16,16,2,0,255,240,255,240,0,48,0,48,0,48,0,48,0,48,0,48, - // 0x00ad ­ + // 0x00ad ­ 32,32,128,32,0,252,204,204,204,204,204,204,204,204,0,0,0,3,0,0,0,3,192,0,0,0,192,0,0,0,15,204,60,15,15,204,60,15,240,12,51,48,240,12,51,48,15,15,240,195,15,15,240,195,192,204,48,192,192,204,48,192,63,12,48,195,63,12,48,195,192,0,0,0,192,0,0,0,0,0,0,3,0,0,0,3,192,0,0,0,192,0,0,0,0,15,240,3,0,15,240,3,192,0,0,0,192,0,0,0,0,0,0,3,0,0,0,3,192,0,0,0,192,0,0,0,51,51,51,51,51,51,51,51, - // 0x00ae ® + // 0x00ae ® 16,20,40,16,0,0,15,240,15,240,48,12,48,12,207,195,207,195,204,51,204,51,204,51,204,51,207,195,207,195,204,195,204,195,204,51,204,51,48,12,48,12,15,240,15,240, - // 0x00af ¯ + // 0x00af ¯ 12,2,4,16,2,22,255,240,255,240, - // 0x00b0 ° + // 0x00b0 ° 8,8,8,16,4,12,60,60,195,195,195,195,60,60, - // 0x00b1 ± + // 0x00b1 ± 14,18,36,16,2,2,3,0,3,0,3,0,3,0,3,0,3,0,255,252,255,252,3,0,3,0,3,0,3,0,3,0,3,0,0,0,0,0,255,252,255,252, - // 0x00b2 ² + // 0x00b2 ² 10,14,28,16,2,8,63,0,63,0,192,192,192,192,0,192,0,192,15,0,15,0,48,0,48,0,192,0,192,0,255,192,255,192, - // 0x00b3 ³ + // 0x00b3 ³ 10,14,28,16,2,8,63,0,63,0,192,192,192,192,0,192,0,192,63,0,63,0,0,192,0,192,192,192,192,192,63,0,63,0, - // 0x00b4 ´ + // 0x00b4 ´ 6,6,6,16,6,20,12,12,48,48,192,192, - // 0x00b5 µ + // 0x00b5 µ 16,20,40,16,0,252,48,12,48,12,48,12,48,12,48,12,48,12,48,12,48,12,48,12,48,12,48,12,48,12,60,60,60,60,51,195,51,195,48,0,48,0,192,0,192,0, - // 0x00b6 ¶ + // 0x00b6 ¶ 14,22,44,16,2,254,63,252,63,252,255,48,255,48,255,48,255,48,255,48,255,48,63,48,63,48,3,48,3,48,3,48,3,48,3,48,3,48,3,48,3,48,3,48,3,48,3,48,3,48, - // 0x00b7 · + // 0x00b7 · 4,4,4,16,6,8,240,240,240,240, - // 0x00b8 ¸ + // 0x00b8 ¸ 6,4,4,16,4,252,12,12,240,240, - // 0x00b9 ¹ + // 0x00b9 ¹ 10,14,28,16,2,8,12,0,12,0,60,0,60,0,204,0,204,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00ba º + // 0x00ba º 10,14,28,16,4,10,63,0,63,0,192,192,192,192,192,192,192,192,192,192,192,192,63,0,63,0,0,0,0,0,255,192,255,192, - // 0x00bb » + // 0x00bb » 12,18,36,16,2,0,195,0,195,0,195,0,195,0,48,192,48,192,48,192,48,192,12,48,12,48,48,192,48,192,48,192,48,192,195,0,195,0,195,0,195,0, - // 0x00bc ¼ + // 0x00bc ¼ 12,20,40,16,2,0,48,48,48,48,240,48,240,48,48,192,48,192,51,0,51,0,51,0,51,0,12,48,12,48,12,240,12,240,51,48,51,48,195,240,195,240,192,48,192,48, - // 0x00bd ½ + // 0x00bd ½ 12,20,40,16,2,0,48,48,48,48,240,48,240,48,48,192,48,192,51,0,51,0,51,0,51,0,12,192,12,192,15,48,15,48,48,48,48,48,192,192,192,192,195,240,195,240, - // 0x00be ¾ + // 0x00be ¾ 12,20,40,16,2,0,240,48,240,48,12,48,12,48,48,192,48,192,15,0,15,0,243,0,243,0,12,48,12,48,12,240,12,240,51,48,51,48,195,240,195,240,192,48,192,48, - // 0x00bf ¿ + // 0x00bf ¿ 12,20,40,16,2,0,12,0,12,0,12,0,12,0,0,0,0,0,12,0,12,0,12,0,12,0,48,0,48,0,192,0,192,0,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00c0 À + // 0x00c0 À 12,28,56,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,15,0,15,0,48,192,48,192,48,192,48,192,192,48,192,48,192,48,192,48,255,240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00c1 Á + // 0x00c1 Á 12,28,56,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,15,0,15,0,48,192,48,192,48,192,48,192,192,48,192,48,192,48,192,48,255,240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00c2  + // 0x00c2  12,28,56,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,15,0,15,0,48,192,48,192,48,192,48,192,192,48,192,48,192,48,192,48,255,240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00c3 à + // 0x00c3 à 12,28,56,16,2,0,60,48,60,48,195,192,195,192,0,0,0,0,0,0,0,0,15,0,15,0,48,192,48,192,48,192,48,192,192,48,192,48,192,48,192,48,255,240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00c4 Ä + // 0x00c4 Ä 12,28,56,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,15,0,15,0,48,192,48,192,48,192,48,192,192,48,192,48,192,48,192,48,255,240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00c5 Ã… + // 0x00c5 Å 12,28,56,16,2,0,15,0,15,0,48,192,48,192,15,0,15,0,0,0,0,0,15,0,15,0,48,192,48,192,48,192,48,192,192,48,192,48,192,48,192,48,255,240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00c6 Æ + // 0x00c6 Æ 14,20,40,16,2,0,15,252,15,252,51,0,51,0,195,0,195,0,195,0,195,0,255,252,255,252,195,0,195,0,195,0,195,0,195,0,195,0,195,0,195,0,195,252,195,252, - // 0x00c7 Ç + // 0x00c7 Ç 12,24,48,16,2,252,63,192,63,192,192,48,192,48,192,48,192,48,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,48,192,48,192,48,192,48,63,192,63,192,3,0,3,0,60,0,60,0, - // 0x00c8 È + // 0x00c8 È 12,28,56,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,255,240,255,240,192,0,192,0,192,0,192,0,192,0,192,0,255,192,255,192,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,255,240,255,240, - // 0x00c9 É + // 0x00c9 É 12,28,56,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,255,240,255,240,192,0,192,0,192,0,192,0,192,0,192,0,255,192,255,192,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,255,240,255,240, - // 0x00ca Ê + // 0x00ca Ê 12,28,56,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,255,240,255,240,192,0,192,0,192,0,192,0,192,0,192,0,255,192,255,192,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,255,240,255,240, - // 0x00cb Ë + // 0x00cb Ë 12,28,56,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,255,240,255,240,192,0,192,0,192,0,192,0,192,0,192,0,255,192,255,192,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,255,240,255,240, - // 0x00cc ÃŒ + // 0x00cc Ì 10,28,56,16,4,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,255,192,255,192,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00cd Í + // 0x00cd Í 10,28,56,16,4,0,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,255,192,255,192,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00ce ÃŽ + // 0x00ce Î 10,28,56,16,4,0,60,0,60,0,195,0,195,0,0,0,0,0,0,0,0,0,255,192,255,192,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00cf Ï + // 0x00cf Ï 10,28,56,16,4,0,195,0,195,0,195,0,195,0,0,0,0,0,0,0,0,0,255,192,255,192,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00d0 Ð + // 0x00d0 Ð 14,20,40,16,0,0,63,192,63,192,48,48,48,48,48,12,48,12,48,12,48,12,255,12,255,12,48,12,48,12,48,12,48,12,48,12,48,12,48,48,48,48,63,192,63,192, - // 0x00d1 Ñ + // 0x00d1 Ñ 12,28,56,16,2,0,60,48,60,48,195,192,195,192,0,0,0,0,0,0,0,0,192,48,192,48,240,48,240,48,240,48,240,48,204,48,204,48,204,48,204,48,195,48,195,48,195,48,195,48,192,240,192,240,192,240,192,240,192,48,192,48, - // 0x00d2 Ã’ + // 0x00d2 Ò 12,28,56,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00d3 Ó + // 0x00d3 Ó 12,28,56,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00d4 Ô + // 0x00d4 Ô 12,28,56,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00d5 Õ + // 0x00d5 Õ 12,28,56,16,2,0,60,48,60,48,195,192,195,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00d6 Ö + // 0x00d6 Ö 12,28,56,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00d7 × + // 0x00d7 × 12,10,20,16,2,4,192,48,192,48,48,192,48,192,15,0,15,0,48,192,48,192,192,48,192,48, - // 0x00d8 Ø + // 0x00d8 Ø 12,24,48,16,2,254,0,48,0,48,63,48,63,48,192,192,192,192,192,240,192,240,195,48,195,48,195,48,195,48,204,48,204,48,204,48,204,48,240,48,240,48,48,48,48,48,207,192,207,192,192,0,192,0, - // 0x00d9 Ù + // 0x00d9 Ù 12,28,56,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00da Ú + // 0x00da Ú 12,28,56,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00db Û + // 0x00db Û 12,28,56,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00dc Ãœ + // 0x00dc Ü 12,28,56,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00dd Ý + // 0x00dd Ý 14,28,56,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,192,12,192,12,192,12,192,12,48,48,48,48,48,48,48,48,12,192,12,192,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0, - // 0x00de Þ + // 0x00de Þ 12,22,44,16,2,0,192,0,192,0,192,0,192,0,255,0,255,0,192,192,192,192,192,48,192,48,192,48,192,48,192,192,192,192,255,0,255,0,192,0,192,0,192,0,192,0,192,0,192,0, - // 0x00df ß + // 0x00df ß 12,20,40,16,2,0,63,0,63,0,192,192,192,192,192,192,192,192,195,0,195,0,207,0,207,0,192,192,192,192,192,48,192,48,192,48,192,48,204,48,204,48,195,192,195,192, - // 0x00e0 à + // 0x00e0 à 12,24,48,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00e1 á + // 0x00e1 á 12,24,48,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00e2 â + // 0x00e2 â 12,24,48,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00e3 ã + // 0x00e3 ã 12,24,48,16,2,0,60,48,60,48,195,192,195,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00e4 ä + // 0x00e4 ä 12,24,48,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00e5 Ã¥ + // 0x00e5 å 12,26,52,16,2,0,15,0,15,0,48,192,48,192,15,0,15,0,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00e6 æ + // 0x00e6 æ 14,16,32,16,2,0,63,240,63,240,195,12,195,12,3,12,3,12,63,252,63,252,195,0,195,0,195,0,195,0,195,12,195,12,63,240,63,240, - // 0x00e7 ç + // 0x00e7 ç 12,20,40,16,2,252,63,192,63,192,192,48,192,48,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,48,192,48,63,192,63,192,3,0,3,0,60,0,60,0, - // 0x00e8 è + // 0x00e8 è 12,24,48,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,255,240,255,240,192,0,192,0,192,0,192,0,192,48,192,48,63,192,63,192, - // 0x00e9 é + // 0x00e9 é 12,24,48,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,255,240,255,240,192,0,192,0,192,0,192,0,192,48,192,48,63,192,63,192, - // 0x00ea ê + // 0x00ea ê 12,24,48,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,255,240,255,240,192,0,192,0,192,0,192,0,192,48,192,48,63,192,63,192, - // 0x00eb ë + // 0x00eb ë 12,24,48,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,255,240,255,240,192,0,192,0,192,0,192,0,192,48,192,48,63,192,63,192, - // 0x00ec ì + // 0x00ec ì 10,24,48,16,4,0,240,0,240,0,15,0,15,0,0,0,0,0,0,0,0,0,60,0,60,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00ed í + // 0x00ed í 10,24,48,16,4,0,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,60,0,60,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00ee î + // 0x00ee î 10,24,48,16,4,0,60,0,60,0,195,0,195,0,0,0,0,0,0,0,0,0,60,0,60,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00ef ï + // 0x00ef ï 10,24,48,16,4,0,195,0,195,0,195,0,195,0,0,0,0,0,0,0,0,0,60,0,60,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,255,192,255,192, - // 0x00f0 ð + // 0x00f0 ð 12,24,48,16,2,0,60,48,60,48,3,192,3,192,12,192,12,192,48,48,48,48,0,48,0,48,63,240,63,240,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00f1 ñ + // 0x00f1 ñ 12,24,48,16,2,0,60,48,60,48,195,192,195,192,0,0,0,0,0,0,0,0,207,192,207,192,240,48,240,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48, - // 0x00f2 ò + // 0x00f2 ò 12,24,48,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00f3 ó + // 0x00f3 ó 12,24,48,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00f4 ô + // 0x00f4 ô 12,24,48,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00f5 õ + // 0x00f5 õ 12,24,48,16,2,0,60,48,60,48,195,192,195,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00f6 ö + // 0x00f6 ö 12,24,48,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,63,192,63,192,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,63,192,63,192, - // 0x00f7 ÷ + // 0x00f7 ÷ 12,14,28,16,2,2,15,0,15,0,0,0,0,0,0,0,0,0,255,240,255,240,0,0,0,0,0,0,0,0,15,0,15,0, - // 0x00f8 ø + // 0x00f8 ø 12,20,40,16,2,254,0,48,0,48,63,192,63,192,192,240,192,240,195,48,195,48,195,48,195,48,204,48,204,48,204,48,204,48,240,48,240,48,63,192,63,192,192,0,192,0, - // 0x00f9 ù + // 0x00f9 ù 12,24,48,16,2,0,60,0,60,0,3,192,3,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00fa ú + // 0x00fa ú 12,24,48,16,2,0,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00fb û + // 0x00fb û 12,24,48,16,2,0,15,0,15,0,48,192,48,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00fc ü + // 0x00fc ü 12,24,48,16,2,0,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,240,192,240,63,48,63,48, - // 0x00fd ý + // 0x00fd ý 12,28,56,16,2,252,3,192,3,192,60,0,60,0,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,48,240,48,240,15,48,15,48,0,48,0,48,0,48,0,48,63,192,63,192, - // 0x00fe þ + // 0x00fe þ 12,26,52,16,2,252,192,0,192,0,192,0,192,0,192,0,192,0,207,192,207,192,240,48,240,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,240,48,240,48,207,192,207,192,192,0,192,0,192,0,192,0, - // 0x00ff ÿ + // 0x00ff ÿ 12,28,56,16,2,252,48,192,48,192,48,192,48,192,0,0,0,0,0,0,0,0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,48,240,48,240,15,48,15,48,0,48,0,48,0,48,0,48,63,192,63,192, }; diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index 2309bb9092c5e..85966670477b4 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -76,7 +76,7 @@ #define LCODE_zh_CN _SIMPLIFIED_CHINESE #define LCODE_zh_TW _TRADITIONAL_CHINESE -#define _LCODE(N) (LCODE_ ## LCD_LANGUAGE == N) +#define _LCODE(N) (CAT(LCODE_, LCD_LANGUAGE) == N) #if _LCODE(_LATIN_EXTENDED_A) #define FONT_EXTRA Latin_Extended_A diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index dc2ba45764c2f..96d22fdd389cb 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -29,6 +29,10 @@ #include "motion.h" +#if ENABLED(DWIN_LCD_PROUI) + #include "../lcd/e3v2/proui/dwin.h" +#endif + #if HAS_BED_PROBE enum ProbePtRaise : uint8_t { PROBE_PT_NONE, // No raise or stow after run_z_probe @@ -45,12 +49,14 @@ #define PROBE_TRIGGERED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) #endif -#ifdef Z_AFTER_HOMING - #define Z_POST_CLEARANCE Z_AFTER_HOMING +#if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) + #define Z_POST_CLEARANCE HMI_data.z_after_homing; +#elif defined(Z_AFTER_HOMING) + #define Z_POST_CLEARANCE Z_AFTER_HOMING #elif defined(Z_HOMING_HEIGHT) - #define Z_POST_CLEARANCE Z_HOMING_HEIGHT + #define Z_POST_CLEARANCE Z_HOMING_HEIGHT #else - #define Z_POST_CLEARANCE 10 + #define Z_POST_CLEARANCE 10 #endif #if ENABLED(PREHEAT_BEFORE_LEVELING) @@ -155,7 +161,9 @@ class Probe { #endif static void move_z_after_homing() { - #ifdef Z_AFTER_HOMING + #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) + do_z_clearance(HMI_data.z_after_homing, true); + #elif defined(Z_AFTER_HOMING) do_z_clearance(Z_AFTER_HOMING, true); #elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE) move_z_after_probing(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 9a7635fc51fb7..afdbf3d10342e 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -166,7 +166,7 @@ #include "../feature/fancheck.h" #endif -#if ENABLED(DGUS_LCD_UI_MKS) +#if DGUS_LCD_UI_MKS #include "../lcd/extui/dgus/DGUSScreenHandler.h" #include "../lcd/extui/dgus/DGUSDisplayDef.h" #endif @@ -569,7 +569,7 @@ typedef struct SettingsDataStruct { // // MKS UI controller // - #if ENABLED(DGUS_LCD_UI_MKS) + #if DGUS_LCD_UI_MKS MKS_Language mks_language_index; // Display Language xy_int_t mks_corner_offsets[5]; // Bed Tramming xyz_int_t mks_park_pos; // Custom Parking (without NOZZLE_PARK) @@ -1614,7 +1614,7 @@ void MarlinSettings::postprocess() { // // MKS UI controller // - #if ENABLED(DGUS_LCD_UI_MKS) + #if DGUS_LCD_UI_MKS EEPROM_WRITE(mks_language_index); EEPROM_WRITE(mks_corner_offsets); EEPROM_WRITE(mks_park_pos); @@ -2527,7 +2527,7 @@ void MarlinSettings::postprocess() { #endif // - // Creality DWIN User Data + // DWIN User Data // #if ENABLED(DWIN_LCD_PROUI) { @@ -2602,7 +2602,7 @@ void MarlinSettings::postprocess() { // // MKS UI controller // - #if ENABLED(DGUS_LCD_UI_MKS) + #if DGUS_LCD_UI_MKS _FIELD_TEST(mks_language_index); EEPROM_READ(mks_language_index); EEPROM_READ(mks_corner_offsets); @@ -2852,7 +2852,7 @@ void MarlinSettings::postprocess() { #endif #if ENABLED(DWIN_LCD_PROUI) - status = !BedLevelTools.meshvalidate(); + status = !bedLevelTools.meshvalidate(); if (status) { bedlevel.invalidate(); LCD_MESSAGE(MSG_UBL_MESH_INVALID); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 46b21a20b68c6..70a1e25ceca35 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3015,7 +3015,7 @@ void Stepper::init() { void Stepper::set_shaping_frequency(const AxisEnum axis, const float freq) { // enabling or disabling shaping whilst moving can result in lost steps - Planner::synchronize(); + planner.synchronize(); const bool was_on = hal.isr_state(); hal.isr_off(); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d7c31ebbeb652..d01b4bc14237b 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -657,7 +657,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(HAS_FAN_LOGIC, fan_update_ms = next_temp_ms + fan_update_interval_ms); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_STARTED)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PID_BED_START : PID_EXTR_START)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); @@ -1314,14 +1314,14 @@ void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_m #endif } -void Temperature::max_temp_error(const heater_id_t heater_id) { +void Temperature::maxtemp_error(const heater_id_t heater_id) { #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) DWIN_Popup_Temperature(1); #endif _temp_error(heater_id, F(STR_T_MAXTEMP), GET_TEXT_F(MSG_ERR_MAXTEMP)); } -void Temperature::min_temp_error(const heater_id_t heater_id) { +void Temperature::mintemp_error(const heater_id_t heater_id) { #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) DWIN_Popup_Temperature(0); #endif @@ -1525,7 +1525,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { void Temperature::manage_hotends(const millis_t &ms) { HOTEND_LOOP() { #if ENABLED(THERMAL_PROTECTION_HOTENDS) - if (degHotend(e) > temp_range[e].maxtemp) max_temp_error((heater_id_t)e); + if (degHotend(e) > temp_range[e].maxtemp) maxtemp_error((heater_id_t)e); #endif TERN_(HEATER_IDLE_HANDLER, heater_idle[e].update(ms)); @@ -1559,7 +1559,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { void Temperature::manage_heated_bed(const millis_t &ms) { #if ENABLED(THERMAL_PROTECTION_BED) - if (degBed() > BED_MAXTEMP) max_temp_error(H_BED); + if (degBed() > BED_MAXTEMP) maxtemp_error(H_BED); #endif #if WATCH_BED @@ -1599,22 +1599,25 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { #endif #if HEATER_IDLE_HANDLER - if (heater_idle[IDLE_INDEX_BED].timed_out) { + const bool bed_timed_out = heater_idle[IDLE_INDEX_BED].timed_out; + if (bed_timed_out) { temp_bed.soft_pwm_amount = 0; if (DISABLED(PIDTEMPBED)) WRITE_HEATER_BED(LOW); } - else + #else + constexpr bool bed_timed_out = false; #endif - { + + if (!bed_timed_out) { #if ENABLED(PIDTEMPBED) temp_bed.soft_pwm_amount = WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; #else // Check if temperature is within the correct band if (WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP)) { #if ENABLED(BED_LIMIT_SWITCHING) - if (temp_bed.celsius >= temp_bed.target + BED_HYSTERESIS) + if (temp_bed.is_above_target((BED_HYSTERESIS) - 1)) temp_bed.soft_pwm_amount = 0; - else if (temp_bed.is_below_target(-(BED_HYSTERESIS) + 1)) + else if (temp_bed.is_below_target((BED_HYSTERESIS) - 1)) temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1; #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING temp_bed.soft_pwm_amount = temp_bed.is_below_target() ? MAX_BED_POWER >> 1 : 0; @@ -1641,7 +1644,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { #endif #if ENABLED(THERMAL_PROTECTION_CHAMBER) - if (degChamber() > CHAMBER_MAXTEMP) max_temp_error(H_CHAMBER); + if (degChamber() > (CHAMBER_MAXTEMP)) maxtemp_error(H_CHAMBER); #endif #if WATCH_CHAMBER @@ -1669,13 +1672,12 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { #if CHAMBER_FAN_MODE == 0 fan_chamber_pwm = CHAMBER_FAN_BASE; #elif CHAMBER_FAN_MODE == 1 - fan_chamber_pwm = (temp_chamber.celsius > temp_chamber.target) ? (CHAMBER_FAN_BASE) + (CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target) : 0; + fan_chamber_pwm = temp_chamber.is_above_target() ? (CHAMBER_FAN_BASE) + (CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target) : 0; #elif CHAMBER_FAN_MODE == 2 fan_chamber_pwm = (CHAMBER_FAN_BASE) + (CHAMBER_FAN_FACTOR) * ABS(temp_chamber.celsius - temp_chamber.target); - if (temp_chamber.soft_pwm_amount) - fan_chamber_pwm += (CHAMBER_FAN_FACTOR) * 2; + if (temp_chamber.soft_pwm_amount) fan_chamber_pwm += (CHAMBER_FAN_FACTOR) * 2; #elif CHAMBER_FAN_MODE == 3 - fan_chamber_pwm = CHAMBER_FAN_BASE + _MAX((CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target), 0); + fan_chamber_pwm = (CHAMBER_FAN_BASE) + _MAX((CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target), 0); #endif NOMORE(fan_chamber_pwm, 255); set_fan_speed(CHAMBER_FAN_INDEX, fan_chamber_pwm); @@ -1688,7 +1690,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { #ifndef MIN_COOLING_SLOPE_DEG_CHAMBER_VENT #define MIN_COOLING_SLOPE_DEG_CHAMBER_VENT 1.5 #endif - if (!flag_chamber_excess_heat && temp_chamber.celsius - temp_chamber.target >= HIGH_EXCESS_HEAT_LIMIT) { + if (!flag_chamber_excess_heat && temp_chamber.is_above_target((HIGH_EXCESS_HEAT_LIMIT) - 1)) { // Open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds if the // temperature didn't drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT if (next_cool_check_ms_2 == 0 || ELAPSED(ms, next_cool_check_ms_2)) { @@ -1702,7 +1704,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { next_cool_check_ms_2 = 0; old_temp = 9999; } - if (flag_chamber_excess_heat && (temp_chamber.target - temp_chamber.celsius >= LOW_EXCESS_HEAT_LIMIT)) + if (flag_chamber_excess_heat && temp_chamber.is_above_target((LOW_EXCESS_HEAT_LIMIT) - 1)) flag_chamber_excess_heat = false; #endif } @@ -1734,9 +1736,9 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { } else { #if ENABLED(CHAMBER_LIMIT_SWITCHING) - if (temp_chamber.celsius >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS) + if (temp_chamber.is_above_target((TEMP_CHAMBER_HYSTERESIS) - 1)) temp_chamber.soft_pwm_amount = 0; - else if (temp_chamber.is_below_target(-(TEMP_CHAMBER_HYSTERESIS) + 1)) + else if (temp_chamber.is_below_target((TEMP_CHAMBER_HYSTERESIS) - 1)) temp_chamber.soft_pwm_amount = (MAX_CHAMBER_POWER) >> 1; #else temp_chamber.soft_pwm_amount = temp_chamber.is_below_target() ? (MAX_CHAMBER_POWER) >> 1 : 0; @@ -1768,7 +1770,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { #endif #if ENABLED(THERMAL_PROTECTION_COOLER) - if (degCooler() > COOLER_MAXTEMP) max_temp_error(H_COOLER); + if (degCooler() > COOLER_MAXTEMP) maxtemp_error(H_COOLER); #endif #if WATCH_COOLER @@ -1788,20 +1790,18 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { if (temp_cooler.target == 0) temp_cooler.target = COOLER_MIN_TARGET; if (ELAPSED(ms, next_cooler_check_ms)) { next_cooler_check_ms = ms + COOLER_CHECK_INTERVAL; - if (temp_cooler.celsius > temp_cooler.target) { - temp_cooler.soft_pwm_amount = temp_cooler.celsius > temp_cooler.target ? MAX_COOLER_POWER : 0; - flag_cooler_state = temp_cooler.soft_pwm_amount > 0 ? true : false; // used to allow M106 fan control when cooler is disabled + if (temp_cooler.is_above_target()) { // too warm? + temp_cooler.soft_pwm_amount = MAX_COOLER_POWER; #if ENABLED(COOLER_FAN) - int16_t fan_cooler_pwm = (COOLER_FAN_BASE) + (COOLER_FAN_FACTOR) * ABS(temp_cooler.celsius - temp_cooler.target); - NOMORE(fan_cooler_pwm, 255); - set_fan_speed(COOLER_FAN_INDEX, fan_cooler_pwm); // Set cooler fan pwm + const int16_t fan_cooler_pwm = (COOLER_FAN_BASE) + (COOLER_FAN_FACTOR) * ABS(temp_cooler.celsius - temp_cooler.target); + set_fan_speed(COOLER_FAN_INDEX, _MIN(fan_cooler_pwm, 255)); // Set cooler fan pwm cooler_fan_flush_ms = ms + 5000; #endif } else { temp_cooler.soft_pwm_amount = 0; #if ENABLED(COOLER_FAN) - set_fan_speed(COOLER_FAN_INDEX, temp_cooler.celsius > temp_cooler.target - 2 ? COOLER_FAN_BASE : 0); + set_fan_speed(COOLER_FAN_INDEX, temp_cooler.is_above_target(-2) ? COOLER_FAN_BASE : 0); #endif WRITE_HEATER_COOLER(LOW); } @@ -1860,20 +1860,20 @@ void Temperature::task() { #if DISABLED(IGNORE_THERMOCOUPLE_ERRORS) #if TEMP_SENSOR_IS_MAX_TC(0) - if (degHotend(0) > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) max_temp_error(H_E0); - if (degHotend(0) < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) min_temp_error(H_E0); + if (degHotend(0) > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E0); + if (degHotend(0) < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) mintemp_error(H_E0); #endif #if TEMP_SENSOR_IS_MAX_TC(1) - if (degHotend(1) > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) max_temp_error(H_E1); - if (degHotend(1) < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) min_temp_error(H_E1); + if (degHotend(1) > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E1); + if (degHotend(1) < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) mintemp_error(H_E1); #endif #if TEMP_SENSOR_IS_MAX_TC(2) - if (degHotend(2) > _MIN(HEATER_2_MAXTEMP, TEMP_SENSOR_2_MAX_TC_TMAX - 1.0)) max_temp_error(H_E2); - if (degHotend(2) < _MAX(HEATER_2_MINTEMP, TEMP_SENSOR_2_MAX_TC_TMIN + .01)) min_temp_error(H_E2); + if (degHotend(2) > _MIN(HEATER_2_MAXTEMP, TEMP_SENSOR_2_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E2); + if (degHotend(2) < _MAX(HEATER_2_MINTEMP, TEMP_SENSOR_2_MAX_TC_TMIN + .01)) mintemp_error(H_E2); #endif #if TEMP_SENSOR_IS_MAX_TC(REDUNDANT) - if (degRedundant() > TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX - 1.0) max_temp_error(H_REDUNDANT); - if (degRedundant() < TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN + .01) min_temp_error(H_REDUNDANT); + if (degRedundant() > TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX - 1.0) maxtemp_error(H_REDUNDANT); + if (degRedundant() < TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN + .01) mintemp_error(H_REDUNDANT); #endif #else #warning "Safety Alert! Disable IGNORE_THERMOCOUPLE_ERRORS for the final build!" @@ -2384,7 +2384,7 @@ void Temperature::updateTemperaturesFromRawValues() { const raw_adc_t r = temp_hotend[e].getraw(); const bool neg = temp_dir[e] < 0, pos = temp_dir[e] > 0; if ((neg && r < temp_range[e].raw_max) || (pos && r > temp_range[e].raw_max)) - max_temp_error((heater_id_t)e); + maxtemp_error((heater_id_t)e); /** // DEBUG PREHEATING TIME @@ -2396,7 +2396,7 @@ void Temperature::updateTemperaturesFromRawValues() { const bool heater_on = temp_hotend[e].target > 0; if (heater_on && !is_preheating(e) && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) { if (TERN1(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, ++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)) - min_temp_error((heater_id_t)e); + mintemp_error((heater_id_t)e); } else { TERN_(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, consecutive_low_temperature_error[e] = 0); @@ -2407,23 +2407,23 @@ void Temperature::updateTemperaturesFromRawValues() { #define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B))) #if ENABLED(THERMAL_PROTECTION_BED) - if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) max_temp_error(H_BED); - if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) min_temp_error(H_BED); + if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) maxtemp_error(H_BED); + if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) mintemp_error(H_BED); #endif #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) - if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER); - if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) min_temp_error(H_CHAMBER); + if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) maxtemp_error(H_CHAMBER); + if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) mintemp_error(H_CHAMBER); #endif #if BOTH(HAS_COOLER, THERMAL_PROTECTION_COOLER) - if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) max_temp_error(H_COOLER); - if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) min_temp_error(H_COOLER); + if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) maxtemp_error(H_COOLER); + if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) mintemp_error(H_COOLER); #endif #if BOTH(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD) - if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) max_temp_error(H_BOARD); - if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) min_temp_error(H_BOARD); + if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) maxtemp_error(H_BOARD); + if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) mintemp_error(H_BOARD); #endif #undef TP_CMP @@ -3138,7 +3138,7 @@ void Temperature::disable_all_heaters() { #endif // Handle an error. If there have been more than THERMOCOUPLE_MAX_ERRORS, send an error over serial. - // Either way, return the TMAX for the thermocouple to trigger a max_temp_error() + // Either way, return the TMAX for the thermocouple to trigger a maxtemp_error() if (max_tc_temp & MAX_TC_ERROR_MASK) { max_tc_errors[hindex]++; diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index c40a418428bc4..091f218eb8374 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -421,7 +421,8 @@ typedef struct TempInfo { typedef struct HeaterInfo : public TempInfo { celsius_t target; uint8_t soft_pwm_amount; - bool is_below_target(const celsius_t offs=0) const { return (celsius < (target + offs)); } + bool is_below_target(const celsius_t offs=0) const { return (target - celsius > offs); } // celsius < target - offs + bool is_above_target(const celsius_t offs=0) const { return (celsius - target > offs); } // celsius > target + offs } heater_info_t; // A heater with PID stabilization @@ -1252,8 +1253,8 @@ class Temperature { #endif static void _temp_error(const heater_id_t e, FSTR_P const serial_msg, FSTR_P const lcd_msg); - static void min_temp_error(const heater_id_t e); - static void max_temp_error(const heater_id_t e); + static void mintemp_error(const heater_id_t e); + static void maxtemp_error(const heater_id_t e); #define HAS_THERMAL_PROTECTION ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_COOLER) diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index f794e178f9111..12a7934a3eada 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -131,12 +131,6 @@ #ifndef E0_AUTO_FAN_PIN #define E0_AUTO_FAN_PIN AUTO_FAN_PIN #endif -#ifndef E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN AUTO_FAN_PIN -#endif -#ifndef E2_AUTO_FAN_PIN - #define E2_AUTO_FAN_PIN AUTO_FAN_PIN -#endif // // SD Card diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 7a8c99e3af1ca..1e354a10dcf2e 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -40,7 +40,9 @@ // Heaters / Fans // // Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 +// +#define MOSFET_B_PIN 7 +#define FAN_PIN 9 // // PSU / SERVO diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h index cfd859f2b6216..d6f9288e8c2fc 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -29,6 +29,8 @@ #define BOARD_INFO_NAME "Melzi" #endif +#define IS_MELZI 1 + #ifndef FAN_PIN #define FAN_PIN 4 #endif diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h index 077f4c73a6576..ccb7a810cdf5f 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h @@ -33,9 +33,10 @@ // #define X_STEP_PIN PB9 #define X_DIR_PIN PC2 -#define Y_STEP_PIN PB7 +#define Y_STEP_PIN PB7 #define Y_DIR_PIN PB8 + #define Z_STEP_PIN PB5 #define Z_DIR_PIN PB6 diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 07255f7e7fe2c..3ec1183083d97 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -581,7 +581,7 @@ void CardReader::startOrResumeFilePrinting() { // void CardReader::endFilePrintNow(TERN_(SD_RESORT, const bool re_sort/*=false*/)) { TERN_(ADVANCED_PAUSE_FEATURE, did_pause_print = 0); - TERN_(HAS_DWIN_E3V2_BASIC, HMI_flag.print_finish = flag.sdprinting); + TERN_(DWIN_CREALITY_LCD, HMI_flag.print_finish = flag.sdprinting); flag.abort_sd_printing = false; if (isFileOpen()) file.close(); TERN_(SD_RESORT, if (re_sort) presort()); diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 31cc202fa94c8..08856350d2ad6 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -132,5 +132,5 @@ def rm_ofile(subdir, name): if 'FILAMENT_RUNOUT_SCRIPT' in env['MARLIN_FEATURES'] and "%c" not in env['MARLIN_FEATURES']['FILAMENT_RUNOUT_SCRIPT']: err = "ERROR: FILAMENT_RUNOUT_SCRIPT needs a %c parameter when NUM_RUNOUT_SENSORS is > 1" raise SystemExit(err) - + sanity_check_target() diff --git a/ini/native.ini b/ini/native.ini index 15a4d36af8d29..7ed705a782e4f 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -26,6 +26,8 @@ build_src_filter = ${common.default_src_filter} + # Native Simulation # Builds with a small subset of available features # Required system libraries: SDL2, SDL2-net, OpenGL, GLM +# sudo apt-get install python3-venv build-essential libsdl2-dev libsdl2-net-dev libglm-dev +# See https://docs.platformio.org/en/latest/platforms/native.html for more information # # Tested with Linux (Mint 20) : gcc [9.3.0, 10.2.0]: libsdl2-dev[2.0.10], libsdl2-net-dev[2.0.1], libglm-dev[0.9.9.7, 0.9.9.8] # @@ -123,8 +125,12 @@ custom_gcc = g++ # Simulator for Windows 10 # # MSYS2 mingw-w64-x86_64 with these packages: -# pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn +# pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn # +# Ensure the following paths have been added to the PATH system environment variable: +# C:\msys64\mingw64\bin, C:\msys64\ucrt64\bin, C:\msys64\usr\bin +# + [env:simulator_windows] extends = simulator_common build_src_flags = ${simulator_common.build_src_flags} -fpermissive