diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2fddb8ae3126..33810011cfbf 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1633,16 +1633,17 @@ * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. */ -#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow -#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done +#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes +#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET) +//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping +#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset -#define Z_PROBE_OFFSET_RANGE_MIN -20 -#define Z_PROBE_OFFSET_RANGE_MAX 20 +#define Z_PROBE_OFFSET_RANGE_MIN -20 // (mm) +#define Z_PROBE_OFFSET_RANGE_MAX 20 // (mm) // Enable the M48 repeatability test to test probe accuracy //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 203825e76b41..4d6ed12e99d5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2275,6 +2275,14 @@ //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif +/** + * Nonlinear Extrusion Control + * + * Control extrusion rate based on instantaneous extruder velocity. Can be used to correct for + * underextrusion at high extruder speeds that are otherwise well-behaved (i.e., not skipping). + */ +//#define NONLINEAR_EXTRUSION + // @section leveling /** diff --git a/Marlin/Version.h b/Marlin/Version.h index 83c6680a3045..39b7f540a818 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-10-09" +//#define STRING_DISTRIBUTION_DATE "2023-10-15" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp index 8c68a2de7f29..8c468e9609f8 100644 --- a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp @@ -75,7 +75,7 @@ static __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart } // Not every MarlinSerial port should handle emergency parsing. -// It would not make sense to parse GCode from TMC responses, for example. +// It would not make sense to parse G-Code from TMC responses, for example. constexpr bool serial_handles_emergency(int port) { return (false #ifdef SERIAL_PORT diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 43a3cf04a870..312e6c2cee92 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -862,7 +862,7 @@ void idle(const bool no_stepper_sleep/*=false*/) { TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER()); // Manage Fixed-time Motion Control - TERN_(FT_MOTION, fxdTiCtrl.loop()); + TERN_(FT_MOTION, ftMotion.loop()); IDLE_DONE: TERN_(MARLIN_DEV_MODE, idle_depth--); @@ -1632,7 +1632,7 @@ void setup() { #endif #if ENABLED(FT_MOTION) - SETUP_RUN(fxdTiCtrl.init()); + SETUP_RUN(ftMotion.init()); #endif marlin_state = MF_RUNNING; diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 020907fe875e..629ae734317e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -460,6 +460,7 @@ #define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6. #define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG) #define BOARD_MELLOW_FLY_E3_V2 5248 // Mellow Fly E3 V2 (STM32F407VG) +#define BOARD_FYSETC_CHEETAH_V30 5249 // FYSETC Cheetah V3.0 (STM32F446RC) // // ARM Cortex-M7 diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 9fc7e99bf565..645725237b44 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -301,6 +301,7 @@ #define STR_CHAMBER_PID "Chamber PID" #define STR_STEPS_PER_UNIT "Steps per unit" #define STR_LINEAR_ADVANCE "Linear Advance" +#define STR_NONLINEAR_EXTRUSION "Nonlinear Extrusion" #define STR_CONTROLLER_FAN "Controller Fan" #define STR_STEPPER_MOTOR_CURRENTS "Stepper motor currents" #define STR_RETRACT_S_F_Z "Retract (S F Z)" diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index bb2bea2e3028..bc0df357ca22 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -178,16 +178,18 @@ #define _DO_N(W,C,N,V...) __DO_N(W,C,N,V) #define DO(W,C,V...) (_DO_N(W,C,NUM_ARGS(V),V)) -// Macros to support option testing +// Concatenate symbol names, without or with pre-expansion #define _CAT(a,V...) a##V #define CAT(a,V...) _CAT(a,V) +// Recognize "true" values: blank, 1, 0x1, true #define _ISENA_ ~,1 #define _ISENA_1 ~,1 #define _ISENA_0x1 ~,1 #define _ISENA_true ~,1 #define _ISENA(V...) IS_PROBE(V) +// Macros to evaluate simple option switches #define _ENA_1(O) _ISENA(CAT(_IS,CAT(ENA_, O))) #define _DIS_1(O) NOT(_ENA_1(O)) #define ENABLED(V...) DO(ENA,&&,V) @@ -198,6 +200,7 @@ #define COUNT_ENABLED(V...) DO(ENA,+,V) #define MANY(V...) (COUNT_ENABLED(V) > 1) +// Ternary pre-compiler macros conceal non-emitted content from the compiler #define TERN(O,A,B) _TERN(_ENA_1(O),B,A) // OPTION ? 'A' : 'B' #define TERN0(O,A) _TERN(_ENA_1(O),0,A) // OPTION ? 'A' : '0' #define TERN1(O,A) _TERN(_ENA_1(O),1,A) // OPTION ? 'A' : '1' @@ -205,7 +208,9 @@ #define _TERN(E,V...) __TERN(_CAT(T_,E),V) // Prepend 'T_' to get 'T_0' or 'T_1' #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. +#define IF_DISABLED(O,A) TERN(O,,A) +// Macros to conditionally emit array items and function arguments #define _OPTITEM(A...) A, #define OPTITEM(O,A...) TERN_(O,DEFER4(_OPTITEM)(A)) #define _OPTARG(A...) , A @@ -220,8 +225,6 @@ #define SUM_TERN(O,B,A) ((B) PLUS_TERN0(O,A)) // ((B) (OPTION ? '+ (A)' : '')) #define DIFF_TERN(O,B,A) ((B) MINUS_TERN0(O,A)) // ((B) (OPTION ? '- (A)' : '')) -#define IF_DISABLED(O,A) TERN(O,,A) - // Macros to support pins/buttons exist testing #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0) #define _PINEX_1 PIN_EXISTS @@ -233,6 +236,7 @@ #define BUTTONS_EXIST(V...) DO(BTNEX,&&,V) #define ANY_BUTTON(V...) DO(BTNEX,||,V) +// Value helper macros #define WITHIN(N,L,H) ((N) >= (L) && (N) <= (H)) #define ISEOL(C) ((C) == '\n' || (C) == '\r') #define NUMERIC(a) WITHIN(a, '0', '9') @@ -240,6 +244,8 @@ #define HEXCHR(a) (NUMERIC(a) ? (a) - '0' : WITHIN(a, 'a', 'f') ? ((a) - 'a' + 10) : WITHIN(a, 'A', 'F') ? ((a) - 'A' + 10) : -1) #define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+') #define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') + +// Array shorthand #define COUNT(a) (sizeof(a)/sizeof(*a)) #define ZERO(a) memset((void*)a,0,sizeof(a)) #define COPY(a,b) do{ \ @@ -247,6 +253,7 @@ memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \ }while(0) +// Expansion of some code #define CODE_16( A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N; O; P #define CODE_15( A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N; O #define CODE_14( A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N @@ -267,6 +274,7 @@ #define _CODE_N(N,V...) CODE_##N(V) #define CODE_N(N,V...) _CODE_N(N,V) +// Expansion of some non-delimited content #define GANG_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A B C D E F G H I J K L M N O P #define GANG_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A B C D E F G H I J K L M N O #define GANG_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A B C D E F G H I J K L M N @@ -288,7 +296,7 @@ #define GANG_N(N,V...) _GANG_N(N,V) #define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K) -// Macros for initializing arrays +// Expansion of some list items #define LIST_26(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z #define LIST_25(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y #define LIST_24(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index fd034f0ba6a4..531dc5b558b0 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -536,7 +536,7 @@ void GcodeSuite::G28() { /** * Preserve DXC mode across a G28 for IDEX printers in DXC_DUPLICATION_MODE. * This is important because it lets a user use the LCD Panel to set an IDEX Duplication mode, and - * then print a standard GCode file that contains a single print that does a G28 and has no other + * then print a standard G-Code file that contains a single print that does a G28 and has no other * IDEX specific commands in it. */ #if ENABLED(DUAL_X_CARRIAGE) diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 6e75ffd4e75c..13965cb72c22 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -44,7 +44,7 @@ void protected_pin_err() { } /** - * M42: Change pin status via GCode + * M42: Change pin status via G-Code * * P Pin number (LED if omitted) * For LPC1768 specify pin P1_02 as M42 P102, diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index e3231480f330..f6e6a1261d46 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -29,13 +29,13 @@ void say_shaping() { // FT Enabled - SERIAL_ECHO_TERNARY(fxdTiCtrl.cfg.mode, "Fixed-Time Motion ", "en", "dis", "abled"); + SERIAL_ECHO_TERNARY(ftMotion.cfg.mode, "Fixed-Time Motion ", "en", "dis", "abled"); // FT Shaping #if HAS_X_AXIS - if (fxdTiCtrl.cfg.mode > ftMotionMode_ENABLED) { + if (ftMotion.cfg.mode > ftMotionMode_ENABLED) { SERIAL_ECHOPGM(" with "); - switch (fxdTiCtrl.cfg.mode) { + switch (ftMotion.cfg.mode) { default: break; case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break; case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break; @@ -51,15 +51,15 @@ void say_shaping() { #endif SERIAL_ECHOLNPGM("."); - const bool z_based = TERN0(HAS_DYNAMIC_FREQ_MM, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_Z_BASED), - g_based = TERN0(HAS_DYNAMIC_FREQ_G, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_MASS_BASED), + const bool z_based = TERN0(HAS_DYNAMIC_FREQ_MM, ftMotion.cfg.dynFreqMode == dynFreqMode_Z_BASED), + g_based = TERN0(HAS_DYNAMIC_FREQ_G, ftMotion.cfg.dynFreqMode == dynFreqMode_MASS_BASED), dynamic = z_based || g_based; // FT Dynamic Frequency Mode - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { #if HAS_DYNAMIC_FREQ SERIAL_ECHOPGM("Dynamic Frequency Mode "); - switch (fxdTiCtrl.cfg.dynFreqMode) { + switch (ftMotion.cfg.dynFreqMode) { default: case dynFreqMode_DISABLED: SERIAL_ECHOPGM("disabled"); break; #if HAS_DYNAMIC_FREQ_MM @@ -74,32 +74,32 @@ void say_shaping() { #if HAS_X_AXIS SERIAL_ECHO_TERNARY(dynamic, "X/A ", "base dynamic", "static", " compensator frequency: "); - SERIAL_ECHO(p_float_t(fxdTiCtrl.cfg.baseFreq[X_AXIS], 2), F("Hz")); + SERIAL_ECHO(p_float_t(ftMotion.cfg.baseFreq[X_AXIS], 2), F("Hz")); #if HAS_DYNAMIC_FREQ - if (dynamic) SERIAL_ECHO(" scaling: ", p_float_t(fxdTiCtrl.cfg.dynFreqK[X_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); + if (dynamic) SERIAL_ECHO(" scaling: ", p_float_t(ftMotion.cfg.dynFreqK[X_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); #endif SERIAL_EOL(); #endif #if HAS_Y_AXIS SERIAL_ECHO_TERNARY(dynamic, "Y/B ", "base dynamic", "static", " compensator frequency: "); - SERIAL_ECHO(p_float_t(fxdTiCtrl.cfg.baseFreq[Y_AXIS], 2), F(" Hz")); + SERIAL_ECHO(p_float_t(ftMotion.cfg.baseFreq[Y_AXIS], 2), F(" Hz")); #if HAS_DYNAMIC_FREQ - if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(fxdTiCtrl.cfg.dynFreqK[Y_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); + if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(ftMotion.cfg.dynFreqK[Y_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); #endif SERIAL_EOL(); #endif } #if HAS_EXTRUDERS - SERIAL_ECHO_TERNARY(fxdTiCtrl.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); - SERIAL_ECHOLN(F(". Gain: "), p_float_t(fxdTiCtrl.cfg.linearAdvK, 5)); + SERIAL_ECHO_TERNARY(ftMotion.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); + SERIAL_ECHOLN(F(". Gain: "), p_float_t(ftMotion.cfg.linearAdvK, 5)); #endif } void GcodeSuite::M493_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F(STR_FT_MOTION)); - const ft_config_t &c = fxdTiCtrl.cfg; + const ft_config_t &c = ftMotion.cfg; SERIAL_ECHOPGM(" M493 S", c.mode); #if HAS_X_AXIS SERIAL_ECHOPGM(" A", c.baseFreq[X_AXIS]); @@ -160,7 +160,7 @@ void GcodeSuite::M493() { // Parse 'S' mode parameter. if (parser.seenval('S')) { - const ftMotionMode_t oldmm = fxdTiCtrl.cfg.mode, + const ftMotionMode_t oldmm = ftMotion.cfg.mode, newmm = (ftMotionMode_t)parser.value_byte(); if (newmm != oldmm) { @@ -179,7 +179,7 @@ void GcodeSuite::M493() { #endif case ftMotionMode_DISABLED: case ftMotionMode_ENABLED: - fxdTiCtrl.cfg.mode = newmm; + ftMotion.cfg.mode = newmm; flag.report_h = true; if (oldmm == ftMotionMode_DISABLED) flag.reset_ft = true; break; @@ -192,7 +192,7 @@ void GcodeSuite::M493() { // Pressure control (linear advance) parameter. if (parser.seen('P')) { const bool val = parser.value_bool(); - fxdTiCtrl.cfg.linearAdvEna = val; + ftMotion.cfg.linearAdvEna = val; SERIAL_ECHO_TERNARY(val, "Linear Advance ", "en", "dis", "abled.\n"); } @@ -200,7 +200,7 @@ void GcodeSuite::M493() { if (parser.seenval('K')) { const float val = parser.value_float(); if (val >= 0.0f) { - fxdTiCtrl.cfg.linearAdvK = val; + ftMotion.cfg.linearAdvK = val; flag.report_h = true; } else // Value out of range. @@ -213,22 +213,22 @@ void GcodeSuite::M493() { // Dynamic frequency mode parameter. if (parser.seenval('D')) { - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { const dynFreqMode_t val = dynFreqMode_t(parser.value_byte()); switch (val) { case dynFreqMode_DISABLED: - fxdTiCtrl.cfg.dynFreqMode = val; + ftMotion.cfg.dynFreqMode = val; flag.report_h = true; break; #if HAS_DYNAMIC_FREQ_MM case dynFreqMode_Z_BASED: - fxdTiCtrl.cfg.dynFreqMode = val; + ftMotion.cfg.dynFreqMode = val; flag.report_h = true; break; #endif #if HAS_DYNAMIC_FREQ_G case dynFreqMode_MASS_BASED: - fxdTiCtrl.cfg.dynFreqMode = val; + ftMotion.cfg.dynFreqMode = val; flag.report_h = true; break; #endif @@ -243,8 +243,8 @@ void GcodeSuite::M493() { } const bool modeUsesDynFreq = ( - TERN0(HAS_DYNAMIC_FREQ_MM, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_Z_BASED) - || TERN0(HAS_DYNAMIC_FREQ_G, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_MASS_BASED) + TERN0(HAS_DYNAMIC_FREQ_MM, ftMotion.cfg.dynFreqMode == dynFreqMode_Z_BASED) + || TERN0(HAS_DYNAMIC_FREQ_G, ftMotion.cfg.dynFreqMode == dynFreqMode_MASS_BASED) ); #endif // HAS_DYNAMIC_FREQ @@ -253,11 +253,11 @@ void GcodeSuite::M493() { // Parse frequency parameter (X axis). if (parser.seenval('A')) { - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { const float val = parser.value_float(); // TODO: Frequency minimum is dependent on the shaper used; the above check isn't always correct. if (WITHIN(val, FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2)) { - fxdTiCtrl.cfg.baseFreq[X_AXIS] = val; + ftMotion.cfg.baseFreq[X_AXIS] = val; flag.update_n = flag.reset_ft = flag.report_h = true; } else // Frequency out of range. @@ -271,7 +271,7 @@ void GcodeSuite::M493() { // Parse frequency scaling parameter (X axis). if (parser.seenval('F')) { if (modeUsesDynFreq) { - fxdTiCtrl.cfg.dynFreqK[X_AXIS] = parser.value_float(); + ftMotion.cfg.dynFreqK[X_AXIS] = parser.value_float(); flag.report_h = true; } else @@ -285,10 +285,10 @@ void GcodeSuite::M493() { // Parse frequency parameter (Y axis). if (parser.seenval('B')) { - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { const float val = parser.value_float(); if (WITHIN(val, FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2)) { - fxdTiCtrl.cfg.baseFreq[Y_AXIS] = val; + ftMotion.cfg.baseFreq[Y_AXIS] = val; flag.update_n = flag.reset_ft = flag.report_h = true; } else // Frequency out of range. @@ -302,7 +302,7 @@ void GcodeSuite::M493() { // Parse frequency scaling parameter (Y axis). if (parser.seenval('H')) { if (modeUsesDynFreq) { - fxdTiCtrl.cfg.dynFreqK[Y_AXIS] = parser.value_float(); + ftMotion.cfg.dynFreqK[Y_AXIS] = parser.value_float(); flag.report_h = true; } else @@ -313,10 +313,10 @@ void GcodeSuite::M493() { #endif // HAS_Y_AXIS #if HAS_X_AXIS - if (flag.update_n) fxdTiCtrl.refreshShapingN(); - if (flag.update_a) fxdTiCtrl.updateShapingA(); + if (flag.update_n) ftMotion.refreshShapingN(); + if (flag.update_a) ftMotion.updateShapingA(); #endif - if (flag.reset_ft) fxdTiCtrl.reset(); + if (flag.reset_ft) ftMotion.reset(); if (flag.report_h) say_shaping(); } diff --git a/Marlin/src/gcode/feature/mixing/M163-M165.cpp b/Marlin/src/gcode/feature/mixing/M163-M165.cpp index a4cb64e7d62c..f4ea52df0a47 100644 --- a/Marlin/src/gcode/feature/mixing/M163-M165.cpp +++ b/Marlin/src/gcode/feature/mixing/M163-M165.cpp @@ -76,7 +76,7 @@ void GcodeSuite::M164() { * I[factor] Mix factor for extruder stepper 6 */ void GcodeSuite::M165() { - // Get mixing parameters from the GCode + // Get mixing parameters from the G-Code // The total "must" be 1.0 (but it will be normalized) // If no mix factors are given, the old mix is preserved const char mixing_codes[] = { LIST_N(MIXING_STEPPERS, 'A', 'B', 'C', 'D', 'H', 'I') }; diff --git a/Marlin/src/gcode/feature/nonlinear/M592.cpp b/Marlin/src/gcode/feature/nonlinear/M592.cpp new file mode 100644 index 000000000000..dc8c1e1e588e --- /dev/null +++ b/Marlin/src/gcode/feature/nonlinear/M592.cpp @@ -0,0 +1,51 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(NONLINEAR_EXTRUSION) + +#include "../../gcode.h" +#include "../../../module/stepper.h" + +void GcodeSuite::M592_report(const bool forReplay/*=true*/) { + report_heading(forReplay, F(STR_NONLINEAR_EXTRUSION)); + SERIAL_ECHOLNPGM(" M593 A", stepper.ne.A, " B", stepper.ne.B, " C", stepper.ne.C); +} + +/** + * M592: Get or set nonlinear extrusion parameters + * A Linear coefficient (default 0.0) + * B Quadratic coefficient (default 0.0) + * C Constant coefficient (default 1.0) + * + * Adjusts the amount of extrusion based on the instantaneous velocity of extrusion, as a multiplier. + * The amount of extrusion is multiplied by max(C, C + A*v + B*v^2) where v is extruder velocity in mm/s. + * Only adjusts forward extrusions, since those are the ones affected by backpressure. + */ +void GcodeSuite::M592() { + if (parser.seenval('A')) stepper.ne.A = parser.value_float(); + if (parser.seenval('B')) stepper.ne.B = parser.value_float(); + if (parser.seenval('C')) stepper.ne.C = parser.value_float(); +} + +#endif // NONLINEAR_EXTRUSION diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index fd2a78d1fd26..d519bd4e2941 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -153,7 +153,7 @@ int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) { } /** - * Set XYZ...E destination and feedrate from the current GCode command + * Set XYZ...E destination and feedrate from the current G-Code command * * - Set destination from included axis codes * - Set to current for missing axis codes @@ -459,7 +459,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // G800: GCode Parser Test for G + case 800: parser.debug(); break; // G800: G-Code Parser Test for G #endif default: parser.unknown_command_warning(); break; @@ -935,6 +935,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 575: M575(); break; // M575: Set serial baudrate #endif + #if ENABLED(NONLINEAR_EXTRUSION) + case 592: M592(); break; // M592: Nonlinear Extrusion control + #endif + #if HAS_ZV_SHAPING case 593: M593(); break; // M593: Input Shaping control #endif @@ -1031,7 +1035,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // M800: GCode Parser Test for M + case 800: parser.debug(); break; // M800: G-Code Parser Test for M #endif #if ENABLED(GCODE_REPEAT_MARKERS) diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index f9ee81f2eb0c..61ff0b047cac 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -259,6 +259,7 @@ * M554 - Get or set IP gateway. (Requires enabled Ethernet port) * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160) * M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE) + * M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION) * M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY]) * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) @@ -461,7 +462,7 @@ class GcodeSuite { */ enum MarlinBusyState : char { NOT_BUSY, // Not in a handler - IN_HANDLER, // Processing a GCode + IN_HANDLER, // Processing a G-Code IN_PROCESS, // Known to be blocking command input (as in G29) PAUSED_FOR_USER, // Blocking pending any input PAUSED_FOR_INPUT // Blocking pending text input (concept) @@ -1106,6 +1107,11 @@ class GcodeSuite { static void M575(); #endif + #if ENABLED(NONLINEAR_EXTRUSION) + static void M592(); + static void M592_report(const bool forReplay=true); + #endif + #if HAS_ZV_SHAPING static void M593(); static void M593_report(const bool forReplay=true); diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index f2835f58918a..646e362517a3 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -21,7 +21,7 @@ */ /** - * parser.cpp - Parser for a GCode line, providing a parameter interface. + * parser.cpp - Parser for a G-Code line, providing a parameter interface. */ #include "parser.h" @@ -66,7 +66,7 @@ uint16_t GCodeParser::codenum; char *GCodeParser::command_args; // start of parameters #endif -// Create a global instance of the GCode parser singleton +// Create a global instance of the G-Code parser singleton GCodeParser parser; /** @@ -108,7 +108,7 @@ void GCodeParser::reset() { /** * Populate the command line state (command_letter, codenum, subcode, and string_arg) - * by parsing a single line of GCode. 58 bytes of SRAM are used to speed up seen/value. + * by parsing a single line of G-Code. 58 bytes of SRAM are used to speed up seen/value. */ void GCodeParser::parse(char *p) { @@ -317,7 +317,7 @@ void GCodeParser::parse(char *p) { #endif #if ENABLED(FASTER_GCODE_PARSER) - // Arguments MUST be uppercase for fast GCode parsing + // Arguments MUST be uppercase for fast G-Code parsing #define PARAM_OK(P) WITHIN((P), 'A', 'Z') #else #define PARAM_OK(P) true diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index c05d6f32c521..5d162c0a41c0 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -22,8 +22,8 @@ #pragma once /** - * parser.h - Parser for a GCode line, providing a parameter interface. - * Codes like M149 control the way the GCode parser behaves, + * parser.h - Parser for a G-Code line, providing a parameter interface. + * Codes like M149 control the way the G-Code parser behaves, * so settings for these codes are located in this class. */ @@ -43,7 +43,7 @@ #endif /** - * GCode parser + * G-Code parser * * - Parse a single G-code line for its letter, code, subcode, and parameters * - FASTER_GCODE_PARSER: @@ -68,7 +68,7 @@ class GCodeParser { public: - // Global states for GCode-level units features + // Global states for G-Code-level units features static bool volumetric_enabled; @@ -233,7 +233,7 @@ class GCodeParser { FORCE_INLINE static char* unescape_string(char* &src) { return src; } #endif - // Populate all fields by parsing a single line of GCode + // Populate all fields by parsing a single line of G-Code // This uses 54 bytes of SRAM to speed up seen/value static void parse(char * p); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 25b9f5cf9b21..aa7ef99f479e 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -35,7 +35,7 @@ class GCodeQueue { */ struct SerialState { /** - * GCode line number handling. Hosts may include line numbers when sending + * G-Code line number handling. Hosts may include line numbers when sending * commands to Marlin, and lines will be checked for sequentiality. * M110 N sets the current line number. */ @@ -48,7 +48,7 @@ class GCodeQueue { static SerialState serial_state[NUM_SERIAL]; //!< Serial states for each serial port /** - * GCode Command Queue + * G-Code Command Queue * A simple (circular) ring buffer of BUFSIZE command strings. * * Commands are copied into this buffer by the command injectors diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9693ed4c4339..2706ca507084 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1439,8 +1439,14 @@ #if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE) #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe #endif - #ifndef Z_PROBE_LOW_POINT - #define Z_PROBE_LOW_POINT -5 + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_BETWEEN_PROBES 5 + #endif + #ifndef Z_CLEARANCE_MULTI_PROBE + #define Z_CLEARANCE_MULTI_PROBE 5 + #endif + #ifndef Z_PROBE_ERROR_TOLERANCE + #define Z_PROBE_ERROR_TOLERANCE Z_CLEARANCE_MULTI_PROBE #endif #if MULTIPLE_PROBING > 1 #if EXTRA_PROBING > 0 @@ -1454,6 +1460,31 @@ #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #undef USE_PROBE_FOR_Z_HOMING #undef Z_MIN_PROBE_REPEATABILITY_TEST + #undef HOMING_Z_WITH_PROBE + #undef Z_CLEARANCE_MULTI_PROBE + #undef Z_PROBE_ERROR_TOLERANCE + #undef MULTIPLE_PROBING + #undef EXTRA_PROBING + #undef Z_PROBE_OFFSET_RANGE_MIN + #undef Z_PROBE_OFFSET_RANGE_MAX + #undef PAUSE_BEFORE_DEPLOY_STOW + #undef PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED + #undef PROBING_HEATERS_OFF + #undef WAIT_FOR_BED_HEATER + #undef WAIT_FOR_HOTEND + #undef PROBING_STEPPERS_OFF + #undef DELAY_BEFORE_PROBING + #undef PREHEAT_BEFORE_PROBING + #undef PROBING_NOZZLE_TEMP + #undef PROBING_BED_TEMP + #undef NOZZLE_TO_PROBE_OFFSET +#endif + +#ifndef Z_CLEARANCE_DEPLOY_PROBE + #define Z_CLEARANCE_DEPLOY_PROBE 10 +#endif +#ifndef Z_PROBE_LOW_POINT + #define Z_PROBE_LOW_POINT -5 #endif #if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 33b42e851195..ab3da7325942 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2960,9 +2960,6 @@ #ifndef NOZZLE_TO_PROBE_OFFSET #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } #endif -#else - #undef NOZZLE_TO_PROBE_OFFSET - #undef PROBING_STEPPERS_OFF #endif /** @@ -3217,10 +3214,10 @@ #endif #endif +#ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING +#endif #if PROBE_SELECTED - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING - #endif #if Z_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_FOR_HOMING #define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_BETWEEN_PROBES #else diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b31d10b06877..0e9ef07eb3fb 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -858,6 +858,19 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif #endif +/** + * Nonlinear Extrusion requirements + */ +#if ENABLED(NONLINEAR_EXTRUSION) + #if DISABLED(ADAPTIVE_STEP_SMOOTHING) + #error "ADAPTIVE_STEP_SMOOTHING is required for NONLINEAR_EXTRUSION." + #elif HAS_MULTI_EXTRUDER + #error "NONLINEAR_EXTRUSION doesn't currently support multi-extruder setups." + #elif DISABLED(CPU_32_BIT) + #error "NONLINEAR_EXTRUSION requires a 32-bit CPU." + #endif +#endif + /** * Special tool-changing options */ diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ecd8f62ddc77..1ce568402db3 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-10-09" + #define STRING_DISTRIBUTION_DATE "2023-10-15" #endif /** diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 4ee52f9106fc..d945db8e588c 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1185,7 +1185,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(FWRETRACT) case PREPARE_FWRETRACT: - if (draw) + if (draw) drawMenuItem(row, ICON_SetHome, GET_TEXT_F(MSG_FWRETRACT), nullptr, true); else drawMenu(ID_FWMenu); @@ -3932,7 +3932,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(FWRETRACT) case TUNE_FWRETRACT: - if (draw) + if (draw) drawMenuItem(row, ICON_SetHome, GET_TEXT_F(MSG_FWRETRACT), nullptr, true); else drawMenu(ID_FWMenu); @@ -4321,7 +4321,7 @@ void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/) case Popup_MPCWait: drawPopup(GET_TEXT_F(MSG_MPC_AUTOTUNE), F("in progress"), PWID, Proc_Wait, ICON_BLTouch); break; #endif case Popup_Resuming: drawPopup(F("Resuming Print"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_Custom: drawPopup(F("Running Custom GCode"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_Custom: drawPopup(F("Running Custom G-Code"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; default: break; } } diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 30c6f9f1f6c2..e6e8384d9065 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -63,14 +63,14 @@ typedef struct { } void clear() { - fileprop.name[0] = '\0'; - fileprop.thumbstart = 0; - fileprop.thumbsize = 0; - fileprop.thumbheight = fileprop.thumbwidth = 0; - fileprop.time = 0; - fileprop.filament = 0; - fileprop.layer = 0; - fileprop.height = fileprop.width = fileprop.length = 0; + name[0] = '\0'; + thumbstart = 0; + thumbsize = 0; + thumbheight = thumbwidth = 0; + time = 0; + filament = 0; + layer = 0; + height = width = length = 0; } } fileprop_t; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h new file mode 100644 index 000000000000..e7b06f7bd397 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h @@ -0,0 +1,134 @@ + +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.pl" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; + +constexpr float x_max = 480.000000; + +constexpr float y_min = 0.000000; + +constexpr float y_max = 272.000000; + +const PROGMEM uint16_t outline[] = { + 0x8278, 0xC8E7, 0x7714, 0xC659, 0x6D20, 0xC0EF, 0x64D1, 0xB8D4, 0x5E5F, 0xAE2F, + 0x5AF5, 0xA493, 0x58F2, 0x99F6, 0x5886, 0x8B4E, 0x590F, 0x7956, 0x5997, 0x69F3, + 0x5B46, 0x5E96, 0x5E92, 0x5430, 0x6363, 0x4AF8, 0x69A4, 0x4327, 0x6F5B, 0x3E4A, + 0x7871, 0x3979, 0x82A1, 0x371E, 0x8CBB, 0x3756, 0x95A1, 0x3997, 0x9D90, 0x3D88, + 0xA50B, 0x43B6, 0xA6BC, 0x46C9, 0xA776, 0x4A42, 0xA669, 0x6D96, 0xA54B, 0x71E5, + 0xA030, 0x7B45, 0x9ECB, 0x7CC5, 0x9B2C, 0x7E1D, 0x9717, 0x7C80, 0x9521, 0x7B11, + 0x8FAD, 0x77D6, 0x8A1D, 0x7607, 0x82E0, 0x7609, 0x7CDD, 0x7812, 0x77F3, 0x7C15, + 0x75EF, 0x7EC5, 0x7830, 0x8278, 0x7D94, 0x8772, 0x847F, 0x8A0B, 0x8B98, 0x89F7, + 0x9127, 0x8806, 0x96AB, 0x849C, 0x9C6D, 0x81F2, 0x9F8E, 0x82E5, 0xA22C, 0x85FF, + 0xA63C, 0x8D9E, 0xA78B, 0x931F, 0xA68F, 0xB5E2, 0xA5D0, 0xB944, 0xA430, 0xBC3E, + 0x9E55, 0xC146, 0x94CA, 0xC660, 0x8A75, 0xC8DB, 0x8278, 0xC8E7, 0x8278, 0xC8E7 +}; + +const PROGMEM uint16_t shadow[] = { + 0x8699, 0x52F4, 0x807A, 0x5409, 0x7A89, 0x576A, 0x7583, 0x5D79, 0x7227, 0x6695, + 0x714B, 0x70C7, 0x71C8, 0x75DB, 0x730A, 0x7A69, 0x7496, 0x7A0E, 0x7601, 0x787F, + 0x78EF, 0x7565, 0x80E9, 0x7178, 0x8924, 0x7108, 0x914E, 0x7393, 0x9914, 0x789A, + 0x9B62, 0x792D, 0x9D8A, 0x7823, 0xA0FE, 0x72DA, 0xA34C, 0x6DC9, 0xA3D7, 0x6766, + 0xA42B, 0x5E98, 0xA3FD, 0x55F8, 0xA279, 0x55CE, 0xA12E, 0x578E, 0x9FE2, 0x59BB, + 0x9E59, 0x5AD8, 0x9AAC, 0x5AE1, 0x9728, 0x58ED, 0x9019, 0x54A3, 0x8699, 0x52F4, + 0x8699, 0x52F4, 0xFFFF, 0x5CA3, 0x849F, 0x5B93, 0x8686, 0x5B52, 0x896F, 0x5B3F, + 0x8FA9, 0x5C60, 0x9D67, 0x6003, 0xA994, 0x6582, 0xB393, 0x6C3B, 0xBAC7, 0x7604, + 0xC0E2, 0x8047, 0xC3D1, 0x8AB3, 0xC3DC, 0x94FB, 0xC14A, 0x9C85, 0xBD52, 0xA35D, + 0xB6C2, 0xA41B, 0xABC2, 0xA460, 0xA092, 0xA416, 0x9C7C, 0xA33E, 0x9B91, 0xA20E, + 0x9C3C, 0x9618, 0xA353, 0x8992, 0xA62E, 0x7CED, 0xA4E9, 0x7097, 0x9FA2, 0x6ADE, + 0x9B4F, 0x65A4, 0x9557, 0x6117, 0x8DDF, 0x5D63, 0x850D, 0x5CA3, 0x849F, 0x5CA3, + 0x849F +}; + +const PROGMEM uint16_t highlight[] = { + 0x861C, 0x5348, 0x8243, 0x53C6, 0x7EBF, 0x5693, 0x7C12, 0x5B55, 0x7ABE, 0x61B3, + 0x7AFC, 0x6656, 0x7C42, 0x6A49, 0x7FB1, 0x7163, 0x862A, 0x7090, 0x8C99, 0x717A, + 0x92E2, 0x740A, 0x98E8, 0x782A, 0x9AB3, 0x7852, 0x9C22, 0x7665, 0x9E0C, 0x7087, + 0x9E69, 0x65BE, 0x9C07, 0x5BDE, 0x9319, 0x568D, 0x8E92, 0x544E, 0x89E2, 0x534D, + 0x861C, 0x5348, 0x861C, 0x5348, 0xFFFF, 0x6B6A, 0x9CA0, 0x69D9, 0x9F11, 0x695E, + 0xA2AD, 0x6A25, 0xAA51, 0x6DB0, 0xBBAA, 0x785A, 0xC170, 0x8372, 0xC3D0, 0x8E9F, + 0xC2E2, 0x9987, 0xBEBD, 0x9CAB, 0xBCE9, 0x9EFE, 0xB9D2, 0x9E63, 0xB379, 0x9CE9, + 0xAD92, 0x98DE, 0xA2B8, 0x8D7F, 0xA5FA, 0x81FE, 0xA636, 0x76A6, 0xA32E, 0x6BC5, + 0x9CA0, 0x6B6A, 0x9CA0, 0x6B6A, 0x9CA0 +}; + +const PROGMEM uint16_t stroke[] = { + 0x8282, 0xC890, 0x7A14, 0xC6FB, 0x7257, 0xC3D9, 0x6B6A, 0xBF38, 0x6569, 0xB928, + 0x5E84, 0xADEC, 0x5B1E, 0xA460, 0x5926, 0x99F8, 0x58A5, 0x90C0, 0x59B6, 0x6B3D, + 0x5B4C, 0x5F6C, 0x5EA3, 0x549E, 0x63A2, 0x4B13, 0x6A2E, 0x430B, 0x71D8, 0x3D0C, + 0x7A7A, 0x3923, 0x83D5, 0x3761, 0x8DAA, 0x37DB, 0x98A8, 0x3B38, 0xA283, 0x4193, + 0xA638, 0x4620, 0xA741, 0x4B64, 0xA6C5, 0x5D20, 0xA613, 0x6E81, 0xA43A, 0x738A, + 0xA01F, 0x7AE8, 0x9DE9, 0x7D0E, 0x9B69, 0x7DBD, 0x9629, 0x7B6D, 0x905C, 0x77C9, + 0x8A94, 0x75BF, 0x8402, 0x7587, 0x7E52, 0x76FE, 0x79CA, 0x79CE, 0x75B1, 0x7EC7, + 0x780B, 0x82C0, 0x7C5E, 0x8702, 0x8193, 0x89A9, 0x8702, 0x8AA4, 0x8C76, 0x8A18, + 0x91F2, 0x8803, 0x977B, 0x8464, 0x9C8C, 0x825E, 0x9EAF, 0x82C4, 0xA0FC, 0x84BC, + 0xA3C6, 0x8965, 0xA6CF, 0x8FEF, 0xA756, 0x9463, 0xA6DA, 0xA612, 0xA5DF, 0xB86B, + 0xA414, 0xBBE7, 0xA03D, 0xBF7C, 0x9648, 0xC56A, 0x8B45, 0xC86E, 0x8282, 0xC890, + 0x8282, 0xC890, 0xFFFF, 0x89EE, 0xC221, 0x9395, 0xBFE8, 0x9C6D, 0xBB4F, 0xA047, + 0xB837, 0xA298, 0xB561, 0xA30A, 0xAA1F, 0xA34B, 0x9D6D, 0xA204, 0x9E54, 0x9820, + 0xA474, 0x960F, 0xA542, 0x886E, 0xA808, 0x803F, 0xA783, 0x785E, 0xA57C, 0x703C, + 0xA168, 0x691E, 0x9BB9, 0x623D, 0x92BA, 0x5D27, 0x8795, 0x5C9D, 0x868D, 0x5C4D, + 0x90BE, 0x5DBC, 0x9E89, 0x6126, 0xA944, 0x6630, 0xB207, 0x6CB0, 0xB914, 0x6E6F, + 0xBA8C, 0x7080, 0xBC05, 0x78E3, 0xC016, 0x8263, 0xC21E, 0x89EE, 0xC221, 0x89EE, + 0xC221, 0xFFFF, 0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0, + 0xA39A, 0x92E9, 0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73, + 0x8FB6, 0x8F97, 0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD, + 0x706D, 0x7C88, 0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0, + 0x76F3, 0x5586, 0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF, + 0x98F7, 0x552D, 0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E, + 0xA381, 0x4A6D, 0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9, + 0x7DFC, 0x3EA4, 0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B, + 0x60B0, 0x5AA7, 0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666, + 0x6620, 0x9016, 0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B, + 0x8CBB, 0xA14B, 0xFFFF, 0x7481, 0x77DA, 0x793F, 0x7317, 0x7EE3, 0x701D, 0x8044, + 0x6FBD, 0x81B4, 0x6F76, 0x846C, 0x6F18, 0x8E1D, 0x7044, 0x97FF, 0x75D2, 0x9B2B, + 0x772F, 0x9DAF, 0x75F3, 0xA26D, 0x6D0E, 0xA2E9, 0x62B8, 0xA33C, 0x583A, 0xA31E, + 0x573E, 0xA252, 0x5871, 0x9FC0, 0x5BDB, 0x9CD5, 0x5D2A, 0x9751, 0x5AEC, 0x914A, + 0x5720, 0x8B83, 0x5519, 0x83E3, 0x5506, 0x7ECB, 0x56B4, 0x7A0F, 0x59E9, 0x765D, + 0x5E9D, 0x73CE, 0x64A3, 0x727C, 0x6BCF, 0x7286, 0x72FD, 0x73A3, 0x78D6, 0x7481, + 0x77DA, 0x7481, 0x77DA +}; + +const PROGMEM uint16_t surface[] = { + 0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0, 0xA39A, 0x92E9, + 0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73, 0x8FB6, 0x8F97, + 0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD, 0x706D, 0x7C88, + 0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0, 0x76F3, 0x5586, + 0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF, 0x98F7, 0x552D, + 0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E, 0xA381, 0x4A6D, + 0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9, 0x7DFC, 0x3EA4, + 0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B, 0x60B0, 0x5AA7, + 0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666, 0x6620, 0x9016, + 0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B, 0x8CBB, 0xA14B +}; + +//#define LOGO_BACKGROUND 0xF05A22 +#define LOGO_BACKGROUND 0xFFFFFF + +#define LOGO_PAINT_PATHS \ + LOGO_PAINT_PATH(0xF27121, surface) \ + LOGO_PAINT_PATH(0x6B2C1B, shadow) \ + LOGO_PAINT_PATH(0xBC3E26, highlight) \ + LOGO_PAINT_PATH(0x3C2215, stroke) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp new file mode 100644 index 000000000000..1de0fbd4a584 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp @@ -0,0 +1,116 @@ +/******************** + * about_screen.cpp * + ********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" + +#ifdef COCOA_ABOUT_SCREEN + +#define GRID_COLS 4 +#define GRID_ROWS 8 + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void AboutScreen::onEntry() { + BaseScreen::onEntry(); + sound.play(chimes, PLAY_ASYNCHRONOUS); +} + +void AboutScreen::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + + #define HEADING_POS BTN_POS(1,1), BTN_SIZE(4,2) + #define FW_VERS_POS BTN_POS(1,3), BTN_SIZE(4,1) + #define FW_INFO_POS BTN_POS(1,4), BTN_SIZE(4,1) + #define LICENSE_POS BTN_POS(1,5), BTN_SIZE(4,3) + #define STATS_POS BTN_POS(1,8), BTN_SIZE(2,1) + #define BACK_POS BTN_POS(3,8), BTN_SIZE(2,1) + + char about_str[1 + + strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + #ifdef TOOLHEAD_NAME + + strlen_P(TOOLHEAD_NAME) + #endif + ]; + #ifdef TOOLHEAD_NAME + // If MSG_ABOUT_TOUCH_PANEL_2 has %s, substitute in the toolhead name. + // But this is optional, so squelch the compiler warning here. + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-extra-args" + sprintf_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2), TOOLHEAD_NAME); + #pragma GCC diagnostic pop + #else + strcpy_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)); + #endif + + draw_text_box(cmd, HEADING_POS, + #ifdef MACHINE_NAME + F(MACHINE_NAME) + #else + GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1) + #endif + , OPT_CENTER, font_xlarge + ); + #if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU) + cmd.tag(3); + #endif + draw_text_box(cmd, FW_VERS_POS, + #ifdef TOUCH_UI_VERSION + F(TOUCH_UI_VERSION) + #else + FPSTR(getFirmwareName_str()) + #endif + , OPT_CENTER, font_medium); + cmd.tag(0); + draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium); + draw_text_box(cmd, LICENSE_POS, GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny); + + cmd.font(font_medium); + #if ENABLED(PRINTCOUNTER) + cmd.colors(normal_btn) + .tag(2).button(STATS_POS, GET_TEXT_F(MSG_INFO_STATS_MENU)); + #endif + cmd.colors(action_btn) + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); +} + +bool AboutScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + #if ENABLED(PRINTCOUNTER) + case 2: GOTO_SCREEN(StatisticsScreen); break; + #endif + #if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU) + case 3: GOTO_SCREEN(DeveloperMenu); break; + #endif + default: return false; + } + return true; +} + +#endif // COCOA_ABOUT_SCREEN diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h new file mode 100644 index 000000000000..2e9bc1827e1a --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h @@ -0,0 +1,33 @@ +/****************** + * about_screen.h * + ******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_ABOUT_SCREEN +#define COCOA_ABOUT_SCREEN_CLASS AboutScreen + +class AboutScreen : public BaseScreen, public UncachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h new file mode 100644 index 000000000000..18fbed9a525c --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h @@ -0,0 +1,248 @@ +const unsigned char cocoa_press_ui[2941] PROGMEM = { + 0x78, 0x9C, 0xED, 0xDD, 0x3B, 0x96, 0xA3, 0xC8, 0xB6, 0x00, 0xD0, 0xC9, + 0x68, 0x28, 0x1A, 0x0A, 0x06, 0x3D, 0x8F, 0x34, 0x24, 0x83, 0x59, 0x94, + 0x91, 0x8E, 0x0C, 0x30, 0x34, 0x86, 0x32, 0xCA, 0x2A, 0x03, 0x23, 0x99, + 0x42, 0x8D, 0xE0, 0x62, 0xE8, 0x0A, 0x21, 0x20, 0x22, 0xF8, 0x54, 0xF6, + 0xBA, 0x6F, 0x3D, 0xA5, 0x52, 0x7B, 0x1B, 0xDD, 0x29, 0x50, 0xA0, 0xA0, + 0xD7, 0x39, 0xC4, 0x0F, 0xE8, 0xCB, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x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A, 0x22, 0x0F, 0xFF, 0xF7, 0x1F, 0xBB, 0xFD, + 0x3F, 0x9A, 0x0E, 0x88, 0xD4, 0x65, 0x51, 0x1C, 0x8B, 0xA2, 0xD8, 0x5C, + 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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D, 0x23, 0xAA, 0xDB, + 0xED, 0x57, 0xF9, 0x6C, 0x3B, 0xBC, 0xB2, 0x76, 0xB8, 0x25, 0xB1, 0x1B, + 0x9F, 0x1F, 0xC6, 0xE9, 0xDE, 0x22, 0xF3, 0x1A, 0x45, 0xE8, 0x06, 0x1E, + 0x7D, 0x82, 0xB4, 0xA7, 0x62, 0x5A, 0xEF, 0x28, 0xAC, 0x7D, 0xC0, 0x4D, + 0x9D, 0xE5, 0x49, 0x5B, 0xD1, 0x1E, 0xA5, 0x07, 0xDC, 0x35, 0x79, 0xFC, + 0x42, 0xD1, 0x32, 0xD3, 0xB9, 0x82, 0xC9, 0x75, 0x70, 0x3E, 0x74, 0xAE, + 0xEA, 0x22, 0x73, 0xDF, 0x15, 0xC4, 0xCA, 0x6C, 0x54, 0x7A, 0xB5, 0x28, + 0xA4, 0xDA, 0xBA, 0x3A, 0x9D, 0xCA, 0x5A, 0xCF, 0x0A, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0xF4, 0x5F, 0xC3, 0x54, 0x94, + 0x5A +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h index 5704371131c6..6219f825dbe3 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h @@ -1,52 +1,32 @@ -/**************************************************************************** - * 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. * - * * - * To view a copy of the GNU General Public License, go to the following * - * location: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ -#pragma once - -constexpr float x_min = 0.000000; -constexpr float x_max = 480.000000; -constexpr float y_min = 0.000000; -constexpr float y_max = 272.000000; - -const PROGMEM uint16_t menu_btn[] = {0x0AAA, 0x0E1E, 0x6D54, 0x0E1E, 0x6D54, 0x2F0E, 0x0AAA, 0x2F0E, 0x0AAA, 0x0E1E}; -const PROGMEM uint16_t print_btn[] = {0x47FF, 0xCF0D, 0x7FFF, 0xCF0D, 0x7FFF, 0xEFFE, 0x47FF, 0xEFFE, 0x47FF, 0xCF0D}; -const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAA, 0x3878, 0x6D54, 0x3878, 0x6D54, 0x5968, 0x0AAA, 0x5968, 0x0AAA, 0x3878}; -const PROGMEM uint16_t extrude_btn[] = {0x0AAA, 0x5E1D, 0x6D54, 0x5E1D, 0x6D54, 0x7F0E, 0x0AAA, 0x7F0E, 0x0AAA, 0x5E1D}; -const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAA, 0x83C2, 0x6D54, 0x83C2, 0x6D54, 0xA4B3, 0x0AAA, 0xA4B3, 0x0AAA, 0x83C2}; -const PROGMEM uint16_t media_btn[] = {0x0AAA, 0xCF0D, 0x42AA, 0xCF0D, 0x42AA, 0xEFFE, 0x0AAA, 0xEFFE, 0x0AAA, 0xCF0D}; -const PROGMEM uint16_t pause_btn[] = {0x8554, 0xCF0D, 0xBD53, 0xCF0D, 0xBD53, 0xEFFE, 0x8554, 0xEFFE, 0x8554, 0xCF0D}; -const PROGMEM uint16_t print_time_hms[] = {0xC59E, 0xAEA0, 0xF510, 0xAEA0, 0xF510, 0xC52D, 0xC59E, 0xC52D, 0xC59E, 0xAEA0}; -const PROGMEM uint16_t file_name[] = {0x0B0E, 0xAECD, 0xBCEF, 0xAECD, 0xBCEF, 0xC4AB, 0x0B0E, 0xC4AB, 0x0B0E, 0xAECD}; -const PROGMEM uint16_t chocolate_label[] = {0x75C1, 0x1369, 0xF4FE, 0x1369, 0xF4FE, 0x2AB1, 0x75C1, 0x2AB1, 0x75C1, 0x1369}; -const PROGMEM uint16_t h0_label[] = {0x8304, 0x4BEB, 0xB271, 0x4BEB, 0xB271, 0x63B0, 0x8304, 0x63B0, 0x8304, 0x4BEB}; -const PROGMEM uint16_t h0_temp[] = {0x8304, 0x7190, 0xB271, 0x7190, 0xB271, 0x8955, 0x8304, 0x8955, 0x8304, 0x7190}; -const PROGMEM uint16_t h1_label[] = {0xBB04, 0x4BEB, 0xEA71, 0x4BEB, 0xEA71, 0x63B0, 0xBB04, 0x63B0, 0xBB04, 0x4BEB}; -const PROGMEM uint16_t h1_temp[] = {0xBB04, 0x7190, 0xEA71, 0x7190, 0xEA71, 0x8956, 0xBB04, 0x8956, 0xBB04, 0x7190}; -const PROGMEM uint16_t stop_btn[] = {0xC2A9, 0xCF0D, 0xF553, 0xCF0D, 0xF553, 0xEFFE, 0xC2A9, 0xEFFE, 0xC2A9, 0xCF0D}; -const PROGMEM uint16_t load_screen_extrude[] = {0x382C, 0x8B02, 0x4188, 0x8B02, 0x4188, 0xAC4A, 0x4637, 0xAC4A, 0x3CDA, 0xBCEE, 0x337D, 0xAC4A, 0x382C, 0xAC4A, 0x382C, 0x8B02}; -const PROGMEM uint16_t load_screen_retract[] = {0x382C, 0x7A5D, 0x4188, 0x7A5D, 0x4188, 0x5915, 0x4637, 0x5915, 0x3CDA, 0x4871, 0x337E, 0x5915, 0x382C, 0x5915, 0x382C, 0x7A5D}; -const PROGMEM uint16_t load_screen_back_btn[] = {0x1555, 0xCA58, 0xEAA8, 0xCA58, 0xEAA8, 0xEFFE, 0x1555, 0xEFFE, 0x1555, 0xCA58}; -const PROGMEM uint16_t load_screen_unload_btn[] = {0x67FF, 0x70F0, 0xEAA8, 0x70F0, 0xEAA8, 0x9695, 0x67FF, 0x9695, 0x67FF, 0x70F0}; -const PROGMEM uint16_t load_screen_start_stop_btn[] = {0x67FF, 0x9B4A, 0xEAA8, 0x9B4A, 0xEAA8, 0xC0EF, 0x67FF, 0xC0EF, 0x67FF, 0x9B4A}; -const PROGMEM uint16_t load_screen_load_btn[] = {0x67FF, 0x4696, 0xEAA8, 0x4696, 0xEAA8, 0x6C3B, 0x67FF, 0x6C3B, 0x67FF, 0x4696}; -const PROGMEM uint16_t load_screen_continuous[] = {0x67FF, 0x1787, 0xEAA8, 0x1787, 0xEAA8, 0x3D2C, 0x67FF, 0x3D2C, 0x67FF, 0x1787}; -const PROGMEM uint16_t load_screen_increment[] = {0x1555, 0x1787, 0x62A9, 0x1787, 0x62A9, 0x3D2C, 0x1555, 0x3D2C, 0x1555, 0x1787}; +const PROGMEM uint16_t menu_btn[] = {0x0AAC, 0x0DF3, 0x6D54, 0x0DF3, 0x6D54, 0x2E89, 0x0AAC, 0x2E89, 0x0AAC, 0x0DF3}; +const PROGMEM uint16_t print_btn[] = {0x4800, 0xCCCC, 0x7FFF, 0xCCCC, 0x7FFF, 0xED62, 0x4800, 0xED62, 0x4800, 0xCCCC}; +const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAC, 0x37D8, 0x6D54, 0x37D8, 0x6D54, 0x586E, 0x0AAC, 0x586E, 0x0AAC, 0x37D8}; +const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAC, 0x5D15, 0x6D54, 0x5D15, 0x6D54, 0x7DAB, 0x0AAC, 0x7DAB, 0x0AAC, 0x5D15}; +const PROGMEM uint16_t extrude_btn[] = {0x0AAC, 0x8252, 0x6D54, 0x8252, 0x6D54, 0xA2E8, 0x0AAC, 0xA2E8, 0x0AAC, 0x8252}; +const PROGMEM uint16_t media_btn[] = {0x0AAC, 0xCCCC, 0x42AA, 0xCCCC, 0x42AA, 0xED62, 0x0AAC, 0xED62, 0x0AAC, 0xCCCC}; +const PROGMEM uint16_t pause_btn[] = {0x8554, 0xCCCC, 0xBD53, 0xCCCC, 0xBD53, 0xED62, 0x8554, 0xED62, 0x8554, 0xCCCC}; +const PROGMEM uint16_t print_time_hms[] = {0xAB02, 0x82EE, 0xE4F8, 0x82EE, 0xE4F8, 0xA24C, 0xAB02, 0xA24C, 0xAB02, 0x82EE}; +const PROGMEM uint16_t print_time_pct[] = {0x7386, 0x82E2, 0xA500, 0x82E2, 0xA500, 0xA258, 0x7386, 0xA258, 0x7386, 0x82E2}; +const PROGMEM uint16_t file_name[] = {0x0B08, 0xA830, 0xF4F5, 0xA830, 0xF4F5, 0xC784, 0x0B08, 0xC784, 0x0B08, 0xA830}; +const PROGMEM uint16_t h0_label[] = {0x85B6, 0x3884, 0xAF9B, 0x3884, 0xAF9B, 0x57C1, 0x85B6, 0x57C1, 0x85B6, 0x3884}; +const PROGMEM uint16_t h0_temp[] = {0x85B6, 0x5DC1, 0xAF9B, 0x5DC1, 0xAF9B, 0x7CFF, 0x85B6, 0x7CFF, 0x85B6, 0x5DC1}; +const PROGMEM uint16_t h1_label[] = {0xBB0B, 0x3884, 0xE4EF, 0x3884, 0xE4EF, 0x57C1, 0xBB0B, 0x57C1, 0xBB0B, 0x3884}; +const PROGMEM uint16_t h1_temp[] = {0xBB0B, 0x5DC1, 0xE4EF, 0x5DC1, 0xE4EF, 0x7CFF, 0xBB0B, 0x7CFF, 0xBB0B, 0x5DC1}; +const PROGMEM uint16_t stop_btn[] = {0xC2A8, 0xCCCC, 0xF551, 0xCCCC, 0xF551, 0xED62, 0xC2A8, 0xED62, 0xC2A8, 0xCCCC}; +const PROGMEM uint16_t z_wizard_heading[] = {0x5332, 0x0FFF, 0xB331, 0x0FFF, 0xB331, 0x2AAA, 0x5332, 0x2AAA, 0x5332, 0x0FFF}; +const PROGMEM uint16_t z_wizard_plus_btn[] = {0x9CCB, 0x3AAA, 0xAFFE, 0x3AAA, 0xAFFE, 0x5554, 0x9CCB, 0x5554, 0x9CCB, 0x3AAA}; +const PROGMEM uint16_t z_wizard_edit_box[] = {0x0CCC, 0x9FFE, 0x5332, 0x9FFE, 0x5332, 0xC553, 0x0CCC, 0xC553, 0x0CCC, 0x9FFE}; +const PROGMEM uint16_t z_wizard_inc1_btn[] = {0x5998, 0xA016, 0x8998, 0xA016, 0x8998, 0xC553, 0x5998, 0xC553, 0x5998, 0xA016}; +const PROGMEM uint16_t z_wizard_inc2_btn[] = {0x8FFE, 0xA016, 0xBFFE, 0xA016, 0xBFFE, 0xC553, 0x8FFE, 0xC553, 0x8FFE, 0xA016}; +const PROGMEM uint16_t z_wizard_inc3_btn[] = {0xC664, 0xA016, 0xF664, 0xA016, 0xF664, 0xC553, 0xC664, 0xC553, 0xC664, 0xA016}; +const PROGMEM uint16_t z_wizard_done_btn[] = {0xBFFE, 0xCFFE, 0xF664, 0xCFFE, 0xF664, 0xF553, 0xBFFE, 0xF553, 0xBFFE, 0xCFFE}; +const PROGMEM uint16_t z_wizard_neg_btn[] = {0x9CCB, 0x5FFF, 0xAFFE, 0x5FFF, 0xAFFE, 0x7AA9, 0x9CCB, 0x7AA9, 0x9CCB, 0x5FFF}; +const PROGMEM uint16_t z_wizard_diagram[] = {0x6D65, 0x4DBE, 0x6D65, 0x6015, 0x7ADB, 0x6015, 0x7F1F, 0x6C6A, 0x8303, 0x6C6A, 0x8747, 0x6015, 0x94BE, 0x6015, 0x94BE, 0x4DBE, 0x6D65, 0x4DBE, 0xFFFF, 0x0D06, 0x8527, 0x0D06, 0x9554, 0xF664, 0x9554, 0xF664, 0x8527, 0x0D06, 0x8527}; +const PROGMEM uint16_t load_screen_extrude[] = {0x382D, 0x897E, 0x4189, 0x897E, 0x4189, 0xAA6A, 0x4638, 0xAA6A, 0x3CDB, 0xBAE0, 0x337F, 0xAA6A, 0x382D, 0xAA6A, 0x382D, 0x897E}; +const PROGMEM uint16_t load_screen_retract[] = {0x382D, 0x7908, 0x4189, 0x7908, 0x4189, 0x581C, 0x4638, 0x581C, 0x3CDB, 0x47A6, 0x337F, 0x581C, 0x382D, 0x581C, 0x382D, 0x7908}; +const PROGMEM uint16_t load_screen_back_btn[] = {0x1556, 0xC825, 0xEAA7, 0xC825, 0xEAA7, 0xED62, 0x1556, 0xED62, 0x1556, 0xC825}; +const PROGMEM uint16_t load_screen_unload_btn[] = {0x67FF, 0x6FB4, 0xEAA7, 0x6FB4, 0xEAA7, 0x94F1, 0x67FF, 0x94F1, 0x67FF, 0x6FB4}; +const PROGMEM uint16_t load_screen_start_stop_btn[] = {0x67FF, 0x9998, 0xEAA7, 0x9998, 0xEAA7, 0xBED6, 0x67FF, 0xBED6, 0x67FF, 0x9998}; +const PROGMEM uint16_t load_screen_load_btn[] = {0x67FF, 0x45CF, 0xEAA7, 0x45CF, 0xEAA7, 0x6B0C, 0x67FF, 0x6B0C, 0x67FF, 0x45CF}; +const PROGMEM uint16_t load_screen_continuous[] = {0x67FF, 0x1743, 0xEAA7, 0x1743, 0xEAA7, 0x3C80, 0x67FF, 0x3C80, 0x67FF, 0x1743}; +const PROGMEM uint16_t load_screen_increment[] = {0x1556, 0x1743, 0x62AA, 0x1743, 0x62AA, 0x3C80, 0x1556, 0x3C80, 0x1556, 0x1743}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp index f058b40e035d..f7c7035761fd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp @@ -171,13 +171,10 @@ void FilesScreen::drawFooter() { cmd.colors(normal_btn) .font(font_medium) .colors(normal_btn) - .enabled(!mydata.flags.is_root) - .tag(245).button(BTN2_POS, F("Up Dir")) + .tag(mydata.flags.is_root ? 240 : 245).button(BTN2_POS, F("Back")) .colors(action_btn); - if (mydata.flags.is_empty) - cmd.tag(240).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_DONE)); - else if (has_selection && mydata.flags.is_dir) + if (has_selection && mydata.flags.is_dir) cmd.tag(244).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_OPEN)); else cmd.tag(241).enabled(has_selection).button(BTN1_POS, F("Select")); @@ -214,12 +211,9 @@ void FilesScreen::gotoPage(uint8_t page) { bool FilesScreen::onTouchEnd(uint8_t tag) { switch (tag) { - case 240: // Done button, always select first file - { - FileList files; - files.seek(0); - GOTO_PREVIOUS(); - } + case 240: // Back button + card.filename[0] = card.longFilename[0] = '\0'; // Clear file selection + GOTO_PREVIOUS(); return true; case 241: // Select highlighted file GOTO_PREVIOUS(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp index fa31ce155332..820594acaba8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp @@ -25,24 +25,31 @@ #if ENABLED(COCOA_LEVELING_MENU) -#if ALL(HAS_BED_PROBE, BLTOUCH) - #include "../../../../feature/bltouch.h" -#endif - using namespace FTDI; using namespace ExtUI; using namespace Theme; -#define GRID_COLS 3 -#define GRID_ROWS 5 -#define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) -#define PROBE_BED_POS BTN_POS(1,2), BTN_SIZE(1,1) -#define SHOW_MESH_POS BTN_POS(2,2), BTN_SIZE(1,1) -#define EDIT_MESH_POS BTN_POS(3,2), BTN_SIZE(1,1) -#define BLTOUCH_TITLE_POS BTN_POS(1,3), BTN_SIZE(3,1) -#define BLTOUCH_RESET_POS BTN_POS(1,4), BTN_SIZE(1,1) -#define BLTOUCH_TEST_POS BTN_POS(2,4), BTN_SIZE(1,1) -#define BACK_POS BTN_POS(1,5), BTN_SIZE(3,1) +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + #define GRID_COLS 3 + #define GRID_ROWS 6 + #define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) + #define WARNING_POS BTN_POS(1,2), BTN_SIZE(3,2) + #define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1) + #define SHOW_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1) + #define EDIT_MESH_POS BTN_POS(3,4), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,6), BTN_SIZE(3,1) +#else + #define GRID_COLS 2 + #define GRID_ROWS 6 + #define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) + #define WARNING_POS BTN_POS(1,2), BTN_SIZE(2,2) + #define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1) + #define SHOW_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1) + + // Hide the editor button if motion to grid point not supported + #define EDIT_MESH_POS BTN_POS(4,7), BTN_SIZE(1,1) +#endif void LevelingMenu::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { @@ -57,38 +64,26 @@ void LevelingMenu::onRedraw(draw_mode_t what) { cmd.font(font_large) .cmd(COLOR_RGB(bg_text_enabled)) .text(BED_MESH_TITLE_POS, GET_TEXT_F(MSG_BED_LEVELING)) - #if ENABLED(BLTOUCH) - .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) - #endif .font(font_medium).colors(normal_btn) .tag(2).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) .enabled(ENABLED(HAS_MESH)) .tag(3).button(SHOW_MESH_POS, GET_TEXT_F(MSG_MESH_VIEW)) .enabled(ENABLED(HAS_MESH)) .tag(4).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH)) - #undef GRID_COLS - #define GRID_COLS 2 - #if ENABLED(BLTOUCH) - .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) - .tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)) - #endif - #undef GRID_COLS - #define GRID_COLS 3 .colors(action_btn) - .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + draw_text_box(cmd, WARNING_POS, F("Remove chocolate cartridge before probing. This reduces the possibility of damaging a part."), OPT_CENTER, font_medium); } } bool LevelingMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; - case 2: BedMeshViewScreen::doProbe(); break; + case 2: SaveSettingsDialogBox::settingsChanged(); injectCommands(F(BED_LEVELING_COMMANDS)); break; case 3: BedMeshViewScreen::show(); break; - case 4: BedMeshEditScreen::show(); break; - #if ENABLED(BLTOUCH) - case 5: injectCommands(F("M280 P0 S60")); break; - case 6: SpinnerDialogBox::enqueueAndWait(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break; - #endif + case 4: SaveSettingsDialogBox::settingsChanged(); BedMeshEditScreen::show(); break; default: return false; } return true; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp index 2f231278f2d8..14dc8c533fa7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp @@ -23,6 +23,7 @@ #include "../config.h" #include "../screens.h" +#include "../../../../module/stepper.h" #ifdef COCOA_MAIN_MENU @@ -34,13 +35,13 @@ using namespace Theme; #define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1) #define MOVE_XYZ_POS BTN_POS(1,2), BTN_SIZE(1,1) -#define TEMPERATURE_POS BTN_POS(2,1), BTN_SIZE(1,1) +#define LEVELING_POS BTN_POS(2,1), BTN_SIZE(1,1) #define MOVE_E_POS BTN_POS(2,2), BTN_SIZE(1,1) #define SPEED_POS BTN_POS(1,3), BTN_SIZE(1,1) #define FLOW_POS BTN_POS(2,3), BTN_SIZE(1,1) -#define ADVANCED_SETTINGS_POS BTN_POS(1,4), BTN_SIZE(1,1) +#define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(1,1) #define DISABLE_STEPPERS_POS BTN_POS(2,4), BTN_SIZE(1,1) -#define LEVELING_POS BTN_POS(1,5), BTN_SIZE(1,1) +#define ADVANCED_SETTINGS_POS BTN_POS(1,5), BTN_SIZE(1,1) #define ABOUT_PRINTER_POS BTN_POS(2,5), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1) @@ -63,6 +64,10 @@ void MainMenu::onRedraw(draw_mode_t what) { .tag( 6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) .tag( 7).button(FLOW_POS, GET_TEXT_F(MSG_FLOW)) .tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .enabled(stepper.axis_is_enabled(X_AXIS) || + stepper.axis_is_enabled(Y_AXIS) || + stepper.axis_is_enabled(Z_AXIS) || + stepper.axis_is_enabled(E0_AXIS)) .tag( 9).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS)) .enabled(ENABLED(HAS_LEVELING)) .tag(10).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) @@ -97,4 +102,12 @@ bool MainMenu::onTouchEnd(uint8_t tag) { return true; } +void MainMenu::onIdle() { + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + if (!EventLoop::is_touch_held()) + onRefresh(); + refresh_timer.start(); + } +} + #endif // COCOA_MAIN_MENU diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h index 460bb4b81a70..85dcbd07e6a5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h @@ -30,4 +30,5 @@ class MainMenu : public BaseScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); static bool onTouchEnd(uint8_t tag); + static void onIdle(); }; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp index 2fabb81ee4db..ff11b6e0d9a8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp @@ -32,40 +32,24 @@ using namespace Theme; #define GRID_ROWS 5 void PreheatMenu::onRedraw(draw_mode_t what) { - const int16_t w = TERN0(COCOA_PRESS_EXTRA_HEATER, has_extra_heater()) ? BTN_W(1) : BTN_W(2); - const int16_t h = BTN_H(1); - if (what & BACKGROUND) { CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) .cmd(CLEAR(true,true,true)) - .tag(0) .cmd(COLOR_RGB(bg_text_enabled)) .font(Theme::font_medium) - .text( BTN_POS(1,1), w, h, GET_TEXT_F(MSG_SELECT_CHOCOLATE_TYPE)); - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - cmd.text( BTN_POS(2,1), w, h, GET_TEXT_F(MSG_EXTERNAL)); - } - #endif + .tag(0).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_SELECT_CHOCOLATE_TYPE)); } if (what & FOREGROUND) { CommandProcessor cmd; cmd.font(Theme::font_medium) .colors(normal_btn) - .tag(2).button(BTN_POS(1,2), w, h, F("Dark Chocolate")) - .tag(3).button(BTN_POS(1,3), w, h, F("Milk Chocolate")) - .tag(4).button(BTN_POS(1,4), w, h, F("White Chocolate")); - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - cmd.tag(5).button(BTN_POS(2,2), w, h, F("Dark Chocolate")) - .tag(6).button(BTN_POS(2,3), w, h, F("Milk Chocolate")) - .tag(7).button(BTN_POS(2,4), w, h, F("White Chocolate")); - } - #endif - cmd.colors(action_btn) - .tag(1) .button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); + .tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), F("Dark Chocolate")) + .tag(3).button(BTN_POS(1,3), BTN_SIZE(2,1), F("Milk Chocolate")) + .tag(4).button(BTN_POS(1,4), BTN_SIZE(2,1), F("White Chocolate")) + .colors(action_btn) + .tag(1).button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); } } @@ -73,38 +57,20 @@ bool PreheatMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; case 2: - #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT + injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; case 3: - #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT + injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; case 4: - #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT)); - #endif - GOTO_SCREEN(PreheatTimerScreen); - break; - case 5: - #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT)); - #endif - GOTO_SCREEN(PreheatTimerScreen); - break; - case 6: - #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT)); - #endif - GOTO_SCREEN(PreheatTimerScreen); - break; - case 7: - #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT + injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp index c4e9d971f6a7..9641b1f9c6a4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp @@ -89,20 +89,20 @@ void PreheatTimerScreen::draw_adjuster(draw_mode_t what, uint8_t tag, FSTR_P lab cmd.tag(0) .font(font_small); if (what & BACKGROUND) { - cmd.text( SUB_POS(1,1), SUB_SIZE(9,1), label) - .button(SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); + cmd.text( SUB_POS(1,1), SUB_SIZE(9,1), label) + .button(SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); } if (what & FOREGROUND) { - char str[32]; - dtostrf(value, 5, 1, str); - strcat_P(str, PSTR(" ")); - strcat_P(str, (const char*) GET_TEXT_F(MSG_UNITS_C)); - - cmd.text(SUB_POS(1,2), SUB_SIZE(5,1), str) - .font(font_medium) - .tag(tag ).button(SUB_POS(6,2), SUB_SIZE(2,1), F("-")) - .tag(tag+1).button(SUB_POS(8,2), SUB_SIZE(2,1), F("+")); + char str[32]; + dtostrf(value, 5, 1, str); + strcat_P(str, PSTR(" ")); + strcat_P(str, (const char*) GET_TEXT_F(MSG_UNITS_C)); + + cmd.text(SUB_POS(1,2), SUB_SIZE(5,1), str) + .font(font_medium) + .tag(tag ).button(SUB_POS(6,2), SUB_SIZE(2,1), F("-")) + .tag(tag+1).button(SUB_POS(8,2), SUB_SIZE(2,1), F("+")); } } @@ -116,7 +116,9 @@ void PreheatTimerScreen::onRedraw(draw_mode_t what) { draw_interaction_buttons(what); draw_adjuster(what, 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0), NOZZLE_ADJ_POS); draw_adjuster(what, 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1), BODY_ADJ_POS); - draw_adjuster(what, 6, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS); + #if HAS_HEATED_CHAMBER + draw_adjuster(what, 6, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS); + #endif } bool PreheatTimerScreen::onTouchHeld(uint8_t tag) { @@ -126,8 +128,10 @@ bool PreheatTimerScreen::onTouchHeld(uint8_t tag) { case 3: UI_INCREMENT(TargetTemp_celsius, E0); break; case 4: UI_DECREMENT(TargetTemp_celsius, E1); break; case 5: UI_INCREMENT(TargetTemp_celsius, E1); break; - case 6: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; - case 7: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; + #if HAS_HEATED_CHAMBER + case 6: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; + case 7: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; + #endif default: return false; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h index 5276f64f4429..3e2b5546e918 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h @@ -84,7 +84,6 @@ enum { #include "../generic/base_numeric_adjustment_screen.h" #include "../generic/dialog_box_base_class.h" #include "../generic/boot_screen.h" -#include "../generic/about_screen.h" #include "../generic/kill_screen.h" #include "../generic/alert_dialog_box.h" #include "../generic/spinner_dialog_box.h" @@ -105,13 +104,10 @@ enum { #include "../generic/lock_screen.h" #include "../generic/endstop_state_screen.h" #include "../generic/display_tuning_screen.h" -#include "../generic/statistics_screen.h" #include "../generic/stepper_current_screen.h" -#include "../generic/z_offset_screen.h" #include "../generic/bed_mesh_base.h" #include "../generic/bed_mesh_view_screen.h" #include "../generic/bed_mesh_edit_screen.h" -#include "../generic/case_light_screen.h" #include "../generic/linear_advance_screen.h" #include "../generic/move_axis_screen.h" #include "../generic/flow_percent_screen.h" @@ -132,3 +128,7 @@ enum { #include "move_e_screen.h" #include "files_screen.h" #include "confirm_start_print_dialog_box.h" +#include "z_offset_screen.h" +#include "z_offset_wizard.h" +#include "about_screen.h" +#include "statistics_screen.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp new file mode 100644 index 000000000000..fd73ca0a4bf1 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp @@ -0,0 +1,83 @@ +/************************* + * statistics_screen.cpp * + *************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" + +#ifdef COCOA_STATISTICS_SCREEN + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define GRID_COLS 4 +#define GRID_ROWS 7 + +void StatisticsScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + char buffer[21]; + + + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + + .font(Theme::font_medium) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) + .font(Theme::font_small) + .tag(0) + .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_COUNT), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_TIME), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_LONGEST), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), OPT_RIGHTX | OPT_CENTERY); + // Don't chain the following, it causes strange issues with evaluation ordering! + cmd.text(BTN_POS(3,2), BTN_SIZE(2,1), getTotalPrints_str(buffer)); + cmd.text(BTN_POS(3,3), BTN_SIZE(2,1), getFinishedPrints_str(buffer)); + cmd.text(BTN_POS(3,4), BTN_SIZE(2,1), getTotalPrintTime_str(buffer)); + cmd.text(BTN_POS(3,5), BTN_SIZE(2,1), getLongestPrint_str(buffer)); + + // Express in grams of chocolate rather than mm + const printStatistics stats = print_job_timer.getStats(); + const long gramsChocolate = stats.filamentUsed * 0.53; // 1mm of extrusion is 0.53g + sprintf_P(buffer, PSTR("%ldg"), gramsChocolate); + cmd.text(BTN_POS(3,6), BTN_SIZE(2,1), buffer); + } + + if (what & FOREGROUND) { + cmd.font(Theme::font_medium) + .colors(action_btn) + .tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BUTTON_DONE)); + } +} + +bool StatisticsScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + default: return false; + } +} + +#endif // COCOA_STATISTICS_SCREEN diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h new file mode 100644 index 000000000000..9e533570318d --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h @@ -0,0 +1,32 @@ +/*********************** + * statistics_screen.h * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_STATISTICS_SCREEN +#define COCOA_STATISTICS_SCREEN_CLASS StatisticsScreen + +class StatisticsScreen : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp index 1312d022c350..421d90bf7ffa 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp @@ -23,22 +23,30 @@ #include "../config.h" #include "../screens.h" +#include "../screen_data.h" #ifdef COCOA_STATUS_SCREEN #include "cocoa_press_ui.h" +#include "cocoa_press_bitmap.h" #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) #define ICON_POS(x,y,w,h) x, y, h, h #define TEXT_POS(x,y,w,h) x + h, y, w - h, h -const uint8_t shadow_depth = 5; - using namespace FTDI; using namespace Theme; using namespace ExtUI; -float StatusScreen::increment; +const uint8_t shadow_depth = 5; + +constexpr static StatusScreenData &mydata = screen_data.StatusScreen; + +// Format for background image + +constexpr uint8_t format = RGB332; +constexpr uint16_t bitmap_w = 800; +constexpr uint16_t bitmap_h = 480; void StatusScreen::_format_time(char *outstr, uint32_t time) { const uint8_t hrs = time / 3600, @@ -69,6 +77,64 @@ void StatusScreen::loadBitmaps() { #endif } +void StatusScreen::draw_bkgnd(draw_mode_t what) { + if (what & BACKGROUND) { + constexpr float scale_w = float(FTDI::display_width)/bitmap_w; + constexpr float scale_h = float(FTDI::display_height)/bitmap_h; + uint16_t linestride; + uint32_t color; + switch (format) { + case RGB565: linestride = bitmap_w * 2; color = 0xFFFFFF; break; + case RGB332: linestride = bitmap_w ; color = 0xFFFFFF; break; + case L1: linestride = bitmap_w/8 ; color = 0x000000; break; + case L2: linestride = bitmap_w/4 ; color = 0x000000; break; + case L4: linestride = bitmap_w/2 ; color = 0x000000; break; + case L8: linestride = bitmap_w ; color = 0x000000; break; + } + CommandProcessor cmd; + cmd.cmd(COLOR_RGB(color)) + .cmd(BITMAP_SOURCE(BACKGROUND_OFFSET)) + .tag(0) + .bitmap_layout(format, linestride, bitmap_h) + .bitmap_size(NEAREST, BORDER, BORDER, bitmap_w*scale_w, bitmap_h*scale_h) + .cmd(BITMAP_TRANSFORM_A(uint32_t(float(256)/scale_w))) + .cmd(BITMAP_TRANSFORM_E(uint32_t(float(256)/scale_h))) + .cmd(BEGIN(BITMAPS)) + .cmd(VERTEX2II(0, 0, 0, 0)) + .cmd(BITMAP_TRANSFORM_A(256)) + .cmd(BITMAP_TRANSFORM_E(256)) + .cmd(COLOR_RGB(bg_text_enabled)); + } +} + +void StatusScreen::send_buffer(CommandProcessor &cmd, const void *data, uint16_t len) { + const char *ptr = (const char*) data; + constexpr uint16_t block_size = 512; + char block[block_size]; + for (;len > 0;) { + const uint16_t nBytes = min(len, block_size); + memcpy_P(block, ptr, nBytes); + cmd.write((const void*)block, nBytes); + cmd.execute(); + if(cmd.has_fault()) { + SERIAL_ECHOLNPGM("Recovering from fault: "); + cmd.reset(); + delay(1000); + return; + } + ptr += nBytes; + len -= nBytes; + } +} + +void StatusScreen::load_background(const void *data, uint16_t len) { + CommandProcessor cmd; + cmd.inflate(BACKGROUND_OFFSET) + .execute(); + send_buffer(cmd, data, len); + cmd.wait(); +} + void StatusScreen::draw_time(draw_mode_t what) { CommandProcessor cmd; PolyUI ui(cmd, what); @@ -96,23 +162,27 @@ void StatusScreen::draw_time(draw_mode_t what) { } } - -void StatusScreen::draw_progress(draw_mode_t what) { +void StatusScreen::draw_percent(draw_mode_t what) { CommandProcessor cmd; PolyUI ui(cmd, what); int16_t x, y, w, h; - - cmd.cmd(COLOR_RGB(accent_color_1)); - cmd.font(font_medium); + ui.bounds(POLY(print_time_pct), x, y, w, h); if (what & FOREGROUND) { - // Draw progress bar - ui.bounds(POLY(file_name), x, y, w, h); - const uint16_t bar_width = w * getProgress_percent() / 100; - cmd.tag(8) - .cmd(COLOR_RGB(accent_color_5)) - .rectangle(x, y, bar_width, h); + const uint16_t current_progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, getProgress_permyriad(), getProgress_percent() * 100); + char progress_str[10]; + sprintf_P(progress_str, + #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) + PSTR("%3d.%02d%%"), uint8_t(current_progress / 100), current_progress % 100 + #else + PSTR("%3d%%"), uint8_t(current_progress / 100) + #endif + ); + + cmd.font(font_medium) + .cmd(COLOR_RGB(bg_text_enabled)) + .text(TEXT_POS(x, y, w, h), progress_str); } } @@ -123,17 +193,8 @@ void StatusScreen::draw_temperature(draw_mode_t what) { int16_t x, y, w, h; if (what & BACKGROUND) { - cmd.cmd(COLOR_RGB(fluid_rgb)); - cmd.font(font_medium).tag(10); - - /*ui.bounds(POLY(temp_lbl), x, y, w, h); - cmd.text(x, y, w, h, F("Temp")); - - ui.bounds(POLY(set_lbl), x, y, w, h); - cmd.text(x, y, w, h, F("Set"));*/ - - ui.bounds(POLY(chocolate_label), x, y, w, h); - cmd.text(x, y, w, h, F("Cocoa Press")); + cmd.cmd(COLOR_RGB(bg_text_enabled)); + cmd.font(font_medium).tag(0); ui.bounds(POLY(h0_label), x, y, w, h); cmd.text(x, y, w, h, GET_TEXT_F(MSG_NOZZLE)); @@ -141,18 +202,6 @@ void StatusScreen::draw_temperature(draw_mode_t what) { ui.bounds(POLY(h1_label), x, y, w, h); cmd.text(x, y, w, h, GET_TEXT_F(MSG_BODY)); - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - ui.bounds(POLY(h2_label), x, y, w, h); - cmd.text(x, y, w, h, GET_TEXT_F(MSG_EXTERNAL)); - } - #endif - - #if ENABLED(COCOA_PRESS_CHAMBER_COOLER) - ui.bounds(POLY(h3_label), x, y, w, h); - cmd.text(x, y, w, h, GET_TEXT_F(MSG_CHAMBER)); - #endif - #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif @@ -160,116 +209,80 @@ void StatusScreen::draw_temperature(draw_mode_t what) { if (what & FOREGROUND) { char str[15]; - cmd.cmd(COLOR_RGB(fluid_rgb)); - - cmd.font(font_large).tag(10); + cmd.font(font_medium).colors(normal_btn).tag(10); // Show the actual temperatures format_temp(str, getActualTemp_celsius(E0)); ui.bounds(POLY(h0_temp), x, y, w, h); - cmd.text(x, y, w, h, str); + cmd.button(x, y, w, h, str); format_temp(str, getActualTemp_celsius(E1)); ui.bounds(POLY(h1_temp), x, y, w, h); - cmd.text(x, y, w, h, str); - - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - format_temp(str, getActualTemp_celsius(E2)); - ui.bounds(POLY(h2_temp), x, y, w, h); - cmd.text(x, y, w, h, str); - } - #endif - - #if ENABLED(COCOA_PRESS_CHAMBER_COOLER) - format_temp(str, getActualTemp_celsius(CHAMBER)); - ui.bounds(POLY(h3_temp), x, y, w, h); - cmd.text(x, y, w, h, str); - #endif - - /*// Show the set temperatures - format_temp(str, getTargetTemp_celsius(E0)); - ui.bounds(POLY(h0_set), x, y, w, h); - cmd.text(x, y, w, h, str); - - format_temp(str, getTargetTemp_celsius(E1)); - ui.bounds(POLY(h1_set), x, y, w, h); - cmd.text(x, y, w, h, str); - - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - format_temp(str, getTargetTemp_celsius(E2)); - ui.bounds(POLY(h2_set), x, y, w, h); - cmd.text(x, y, w, h, str); - } - #endif - - #if ENABLED(COCOA_PRESS_CHAMBER_COOLER) - format_temp(str, getTargetTemp_celsius(CHAMBER)); - ui.bounds(POLY(h3_set), x, y, w, h); - cmd.text(x, y, w, h, str); - #endif*/ + cmd.button(x, y, w, h, str); } } void StatusScreen::draw_buttons(draw_mode_t what) { - int16_t x, y, w, h; + if (what & FOREGROUND) { + int16_t x, y, w, h; - const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected(); - const bool can_select = !isPrinting() && isMediaInserted(); - const bool sdOrHostPrinting = ExtUI::isPrinting(); - const bool sdOrHostPaused = ExtUI::isPrintingPaused(); + const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected(); + const bool can_select = !isPrinting() && isMediaInserted(); + const bool sdOrHostPrinting = ExtUI::isPrinting(); + const bool sdOrHostPaused = ExtUI::isPrintingPaused(); - CommandProcessor cmd; - PolyUI ui(cmd, what); + CommandProcessor cmd; + PolyUI ui(cmd, what); - cmd.font(font_medium).colors(normal_btn); + cmd.font(font_medium).colors(normal_btn); - ui.bounds(POLY(load_chocolate_btn), x, y, w, h); - cmd.tag(1).button(x, y, w, h, GET_TEXT_F(MSG_LOAD_UNLOAD)); + ui.bounds(POLY(load_chocolate_btn), x, y, w, h); + cmd.tag(1).button(x, y, w, h, GET_TEXT_F(MSG_LOAD_UNLOAD)); - ui.bounds(POLY(extrude_btn), x, y, w, h); - cmd.tag(2).button(x, y, w, h, GET_TEXT_F(MSG_EXTRUDE)); + ui.bounds(POLY(extrude_btn), x, y, w, h); + cmd.tag(2).button(x, y, w, h, GET_TEXT_F(MSG_EXTRUDE)); - ui.bounds(POLY(preheat_chocolate_btn), x, y, w, h); - cmd.tag(3).button(x, y, w, h, GET_TEXT_F(MSG_PREHEAT_CHOCOLATE)); + ui.bounds(POLY(preheat_chocolate_btn), x, y, w, h); + cmd.tag(3).button(x, y, w, h, GET_TEXT_F(MSG_PREHEAT_CHOCOLATE)); - ui.bounds(POLY(menu_btn), x, y, w, h); - cmd.tag(4).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MENU)); + ui.bounds(POLY(menu_btn), x, y, w, h); + cmd.tag(4).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MENU)); - ui.bounds(POLY(media_btn), x, y, w, h); - cmd.tag(5).enabled(can_select).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MEDIA)); + ui.bounds(POLY(media_btn), x, y, w, h); + cmd.tag(5).enabled(can_select).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MEDIA)); - ui.bounds(POLY(print_btn), x, y, w, h); - cmd.tag(6).colors(action_btn).enabled(can_print).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_PRINT)); + ui.bounds(POLY(print_btn), x, y, w, h); + cmd.tag(6).colors(action_btn).enabled(can_print).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_PRINT)); - ui.bounds(POLY(pause_btn), x, y, w, h); - cmd.tag(sdOrHostPaused ? 8 : 7).enabled(sdOrHostPrinting).button(x, y, w, h, sdOrHostPaused ? GET_TEXT_F(MSG_BUTTON_RESUME) : GET_TEXT_F(MSG_BUTTON_PAUSE)); + ui.bounds(POLY(pause_btn), x, y, w, h); + cmd.tag(sdOrHostPaused ? 8 : 7).enabled(sdOrHostPrinting).button(x, y, w, h, sdOrHostPaused ? GET_TEXT_F(MSG_BUTTON_RESUME) : GET_TEXT_F(MSG_BUTTON_PAUSE)); - ui.bounds(POLY(stop_btn), x, y, w, h); - cmd.tag(9).enabled(sdOrHostPrinting).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_STOP)); + ui.bounds(POLY(stop_btn), x, y, w, h); + cmd.tag(9).enabled(sdOrHostPrinting).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_STOP)); + } } +// When visible, the file name occupies the same space as the status +// message and must be drawn opaque. void StatusScreen::draw_file(draw_mode_t what) { - int16_t x, y, w, h; + if (mydata.gotMessage) return; - CommandProcessor cmd; - PolyUI ui(cmd, what); + if (what & FOREGROUND) { + int16_t x, y, w, h; - ui.bounds(POLY(file_name), x, y, w, h); + CommandProcessor cmd; + PolyUI ui(cmd, what); + ui.bounds(POLY(file_name), x, y, w, h); - if (what & BACKGROUND) { cmd.tag(5) - .cmd(COLOR_RGB(bg_text_enabled)) + .cmd (COLOR_RGB(bg_color)) + .rectangle(x, y, w, h) + .cmd (COLOR_RGB(bg_text_enabled)) .cmd (BITMAP_SOURCE(File_Icon_Info)) .cmd (BITMAP_LAYOUT(File_Icon_Info)) .cmd (BITMAP_SIZE (File_Icon_Info)) .icon(ICON_POS(x, y, w, h), File_Icon_Info, icon_scale); - } - - if (what & FOREGROUND) { - cmd.cmd(COLOR_RGB(bg_text_enabled)); if (!isMediaInserted()) draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No media present"), OPT_CENTERY, font_small); @@ -282,6 +295,21 @@ void StatusScreen::draw_file(draw_mode_t what) { } } +// The message will be drawn on the background and may be obscured by +// the filename. +void StatusScreen::draw_message(draw_mode_t what, const char *message) { + if (what & BACKGROUND) { + int16_t x, y, w, h; + + CommandProcessor cmd; + PolyUI ui(cmd, what); + ui.bounds(POLY(file_name), x, y, w, h); + + cmd.cmd(COLOR_RGB(bg_text_enabled)); + draw_text_box(cmd, TEXT_POS(x, y, w, h), message, OPT_CENTERY, font_small); + } +} + bool StatusScreen::isFileSelected() { if (!isMediaInserted()) return false; FileList list; @@ -292,23 +320,14 @@ bool StatusScreen::isFileSelected() { } void StatusScreen::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); + if (what & FOREGROUND) { + draw_bkgnd(what); + draw_file(what); + draw_time(what); + draw_percent(what); + draw_temperature(what); + draw_buttons(what); } - - draw_file(what); - draw_time(what); - draw_progress(what); - draw_temperature(what); - draw_buttons(what); -} - -bool StatusScreen::onTouchStart(uint8_t) { - increment = 0; - return true; } bool StatusScreen::onTouchEnd(uint8_t tag) { @@ -353,17 +372,55 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { bool StatusScreen::onTouchHeld(uint8_t tag) { if (tag == 2 && !ExtUI::isMoving()) { - LoadChocolateScreen::setManualFeedrateAndIncrement(1, increment); + float increment; + LoadChocolateScreen::setManualFeedrateAndIncrement(0.25, increment); UI_INCREMENT(AxisPosition_mm, E0); - current_screen.onRefresh(); } return false; } -void StatusScreen::setStatusMessage(FSTR_P) { +void StatusScreen::setStatusMessage(FSTR_P message) { + char buff[strlen_P((const char * const)message)+1]; + strcpy_P(buff, (const char * const) message); + setStatusMessage((const char *) buff); +} + +void StatusScreen::setStatusMessage(const char * const message) { + if (CommandProcessor::is_processing()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Cannot update status message, command processor busy"); + #endif + return; + } + + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)); + + const draw_mode_t what = BACKGROUND; + draw_bkgnd(what); + draw_message(what, message); + draw_time(what); + draw_percent(what); + draw_temperature(what); + draw_buttons(what); + + storeBackground(); + + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("New status message: ", message); + #endif + + mydata.gotMessage = true; + + if (AT_SCREEN(StatusScreen)) + current_screen.onRefresh(); } -void StatusScreen::setStatusMessage(const char * const) { +void StatusScreen::onEntry() { + mydata.gotMessage = false; + load_background(cocoa_press_ui, sizeof(cocoa_press_ui)); } void StatusScreen::onIdle() { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h index 05f99e953d6c..57cf2308ab42 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h @@ -26,31 +26,35 @@ #define COCOA_STATUS_SCREEN #define COCOA_STATUS_SCREEN_CLASS StatusScreen -class StatusScreen : public BaseScreen, public CachedScreen { +struct StatusScreenData { + bool gotMessage; +}; + +class StatusScreen : public BaseScreen, public CachedScreen { private: static void _format_time(char *outstr, uint32_t time); - static float increment; - static bool jog_xy; - static bool fine_motion; - static void draw_time(draw_mode_t what); - static void draw_progress(draw_mode_t what); + static void draw_percent(draw_mode_t what); static void draw_temperature(draw_mode_t what); static void draw_buttons(draw_mode_t what); static void draw_file(draw_mode_t what); + static void draw_message(draw_mode_t what, const char *message); + static void draw_bkgnd(draw_mode_t what); + + static void send_buffer(CommandProcessor &cmd, const void *data, uint16_t len); + static void load_background(const void *data, uint16_t len); static bool isFileSelected(); public: static void loadBitmaps(); - static void unlockMotors(); static void setStatusMessage(const char *); static void setStatusMessage(FSTR_P); static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); + static void onEntry(); static bool onTouchHeld(uint8_t tag); static bool onTouchEnd(uint8_t tag); static void onIdle(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp new file mode 100644 index 000000000000..aeff0d95f8f0 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp @@ -0,0 +1,59 @@ +/*********************** + * z_offset_screen.cpp * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" +#include "../screen_data.h" + +#ifdef COCOA_Z_OFFSET_SCREEN + +#include "z_offset_wizard.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void ZOffsetScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM)); + + w.heading( GET_TEXT_F(MSG_ZPROBE_ZOFFSET)); + w.color(z_axis).adjuster(4, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), getZOffset_mm()); + w.increments(); + w.button(2, GET_TEXT_F(MSG_PROBE_WIZARD), !isPrinting()); +} + +bool ZOffsetScreen::onTouchHeld(uint8_t tag) { + const int16_t steps = TERN(BABYSTEPPING, mmToWholeSteps(getIncrement(), Z), 0); + const float increment = TERN(BABYSTEPPING, mmFromWholeSteps(steps, Z), getIncrement()); + switch (tag) { + case 2: ZOffsetWizard::runWizard(); break; + case 4: UI_DECREMENT(ZOffset_mm); TERN(BABYSTEPPING, babystepAxis_steps(-steps, Z), UNUSED(steps)); break; + case 5: UI_INCREMENT(ZOffset_mm); TERN(BABYSTEPPING, babystepAxis_steps( steps, Z), UNUSED(steps)); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // COCOA_Z_OFFSET_SCREEN diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h new file mode 100644 index 000000000000..93a364c109c6 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h @@ -0,0 +1,32 @@ +/*********************** + * z_offset_screen.h * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_Z_OFFSET_SCREEN +#define COCOA_Z_OFFSET_SCREEN_CLASS ZOffsetScreen + +class ZOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp new file mode 100644 index 000000000000..9672e048d233 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp @@ -0,0 +1,162 @@ +/*********************** + * z_offset_screen.cpp * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" +#include "../screen_data.h" + +#ifdef COCOA_Z_OFFSET_WIZARD + +#include "cocoa_press_ui.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) +#define SHEET_THICKNESS 0.1 + +constexpr static ZOffsetWizardData &mydata = screen_data.ZOffsetWizard; + +void ZOffsetWizard::onEntry() { + mydata.increment = 242; + mydata.softEndstopState = getSoftEndstopState(); + BaseNumericAdjustmentScreen::onEntry(); + setSoftEndstopState(false); +} + +void ZOffsetWizard::onExit() { + setSoftEndstopState(mydata.softEndstopState); +} + +void ZOffsetWizard::onRedraw(draw_mode_t what) { + int16_t x, y, w, h; + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0) + .font(font_medium).colors(normal_btn); + + char b[32]; + dtostrf(getZOffset_mm(), 5, 2, b); + strcat_P(b, PSTR(" mm")); + ui.bounds(POLY(z_wizard_edit_box), x, y, w, h); + cmd.tag(0).fgcolor(z_axis).button(x, y, w, h, b); + + #define PREAMBLE(TAG) cmd.tag(TAG).colors(mydata.increment == TAG ? action_btn : normal_btn) + ui.bounds(POLY(z_wizard_inc1_btn), x, y, w, h); + PREAMBLE(241).button(x, y, w, h, F("0.01")); + + ui.bounds(POLY(z_wizard_inc2_btn), x, y, w, h); + PREAMBLE(242).button(x, y, w, h, F("0.1")); + + ui.bounds(POLY(z_wizard_inc3_btn), x, y, w, h); + PREAMBLE(243).button(x, y, w, h, F("1.0")); + + ui.bounds(POLY(z_wizard_neg_btn), x, y, w, h); + cmd.tag(4).colors(action_btn).button(x, y, w, h, F("")); + drawArrow(x, y, w, h, DOWN); + + ui.bounds(POLY(z_wizard_plus_btn), x, y, w, h); + cmd.tag(5).colors(action_btn).button(x, y, w, h, F("")); + drawArrow(x, y, w, h, UP); + + ui.bounds(POLY(z_wizard_done_btn), x, y, w, h); + cmd.tag(1).colors(action_btn).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_DONE)); + + cmd.tag(0); + ui.color(bg_text_enabled); + ui.fill(POLY(z_wizard_diagram)); + + ui.bounds(POLY(z_wizard_heading), x, y, w, h); + cmd.font(font_large) + .text(x, y, w, h, F("Z Probe Wizard")); +} + +float ZOffsetWizard::getIncrement() { + switch (mydata.increment) { + case 241: return 0.01; + case 242: return 0.1; + case 243: return 1.0; + default: return 0.0; + } +} + +void ZOffsetWizard::runWizard() { + // Restore the default Z offset + constexpr float offset[] = NOZZLE_TO_PROBE_OFFSET; + setZOffset_mm(offset[Z_AXIS]); + // Move above probe point + char cmd[64], str[10]; + strcpy_P(cmd, PSTR("G28 Z\nG0 F1000 X")); + dtostrf(TERN(Z_SAFE_HOMING,Z_SAFE_HOMING_X_POINT,X_CENTER), 3, 1, str); + strcat(cmd, str); + strcat_P(cmd, PSTR("Y")); + dtostrf(TERN(Z_SAFE_HOMING,Z_SAFE_HOMING_Y_POINT,Y_CENTER), 3, 1, str); + strcat(cmd, str); + strcat_P(cmd, PSTR("Z")); + dtostrf(SHEET_THICKNESS, 3, 1, str); + strcat(cmd, str); + injectCommands(cmd); + // Show instructions for user. + AlertDialogBox::show(F("\nOn the next screen, adjust the Z Offset so that a sheet of paper can pass between the nozzle and bed with slight resistance.\n\nOnce the printer stops moving, press Okay to begin.\n")); + // Set the destination screen after the dialog box. + current_screen.forget(); + PUSH_SCREEN(ZOffsetWizard); +} + +bool ZOffsetWizard::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + GOTO_PREVIOUS(); + break; + case 4: + case 5: + return onTouchHeld(tag); + case 241 ... 243: + mydata.increment = tag; + break; + default: + return false; + } + return true; +} + +bool ZOffsetWizard::onTouchHeld(uint8_t tag) { + const float increment = TERN(BABYSTEPPING, + mmFromWholeSteps(mmToWholeSteps(getIncrement(), Z), Z), // Round increment to nearest steps + getIncrement() + ); + switch (tag) { + case 4: UI_DECREMENT(ZOffset_mm); UI_DECREMENT(AxisPosition_mm, Z); break; + case 5: UI_INCREMENT(ZOffset_mm); UI_INCREMENT(AxisPosition_mm, Z); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // COCOA_Z_OFFSET_WIZARD diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h new file mode 100644 index 000000000000..5c02f9803b73 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h @@ -0,0 +1,43 @@ +/*********************** + * z_offset_screen.h * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_Z_OFFSET_WIZARD +#define COCOA_Z_OFFSET_WIZARD_CLASS ZOffsetWizard + +struct ZOffsetWizardData : public BaseNumericAdjustmentScreenData { + uint8_t increment; + bool softEndstopState; +}; + +class ZOffsetWizard : public BaseScreen, public UncachedScreen { + private: + static float getIncrement(); + public: + static void runWizard(); + static void onEntry(); + static void onExit(); + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + static bool onTouchEnd(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index a796c8edcf5f..24d99d7b45b5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -177,6 +177,14 @@ void CLCD::mem_write_pgm(uint32_t reg_address, const void *data, uint16_t len, u spi_ftdi_deselect(); } +// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) +void CLCD::mem_write_xbm(uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_bulk(data, len, padding); + spi_ftdi_deselect(); +} + // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) void CLCD::mem_write_xbm(uint32_t reg_address, FSTR_P data, uint16_t len, uint8_t padding) { spi_ftdi_select(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h index 2e2657a83eec..80a2cece1792 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h @@ -118,6 +118,7 @@ class CLCD { static void mem_write_fill (uint32_t reg_address, uint8_t w_data, uint16_t len); static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); + static void mem_write_xbm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_bulk (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0); static void mem_write_xbm (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index d7f4d31bdc12..c05d6577d04b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -66,14 +66,6 @@ * character (this is not the unicode codepoint) */ - utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) { - utf8_char_t val = *(uint8_t*)c++; - if ((val & 0xC0) == 0xC0) - while ((*c & 0xC0) == 0x80) - val = (val << 8) | *(uint8_t*)c++; - return val; - } - utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) { utf8_char_t val = *(uint8_t*)c++; if ((val & 0xC0) == 0xC0) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index 7818957fcc2d..83ab56df579e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -47,7 +47,6 @@ namespace FTDI { * pointer to the next character */ utf8_char_t get_utf8_char_and_inc(const char *&c); - utf8_char_t get_utf8_char_and_inc(char *&c); /* Returns the next character in a UTF8 string, without incrementing */ diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py old mode 100644 new mode 100755 index f6e4a3e39abe..0f39932c6a92 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Written By Marcio Teixeira 2018 - Aleph Objects, Inc. # @@ -18,6 +18,8 @@ from __future__ import print_function import argparse,re,sys +from html.parser import HTMLParser + usage = ''' This program extracts line segments from a SVG file and writes them as coordinates in a C array. The x and y values will be @@ -107,19 +109,16 @@ def write(self): print("constexpr float y_max = %f;" % self.y_max) print() - def from_svg_view_box(self, svg): - s = re.search(']+>', svg); - if s: - m = re.search('viewBox="([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)"', svg) - if m: - self.x_min = float(m[1]) - self.y_min = float(m[2]) - self.x_max = float(m[3]) - self.y_max = float(m[4]) - return True + def from_svg_view_box(self, viewbox): + m = re.search('([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)', viewbox) + if m: + self.x_min = float(m[1]) + self.y_min = float(m[2]) + self.x_max = float(m[3]) + self.y_max = float(m[4]) + return True return False -# op class WriteDataStructure: def __init__(self, bounding_box): self.bounds = bounding_box @@ -143,19 +142,29 @@ def path_finished(self, id): print("const PROGMEM uint16_t", id + "[] = {" + ", ".join (self.hex_words) + "};") self.hex_words = [] -class Parser: - def __init__(self, op): +class SVGParser(HTMLParser): + def __init__(self, args): + super().__init__() + self.args = args + self.tags = [] + self.groups = [] + self.op = None + self.restart() + + def set_consumer(self, op): self.op = op - self.reset() + if self.op: + self.op.reset() - def reset(self): + def restart(self): self.last_x = 0 self.last_y = 0 self.initial_x = 0 self.initial_y = 0 def process_svg_path_L_or_M(self, cmd, x, y): - self.op.command(cmd, x, y) + if self.op: + self.op.command(cmd, x, y) self.last_x = x self.last_y = y if cmd == "M": @@ -239,42 +248,71 @@ def process_svg_path_data(self, id, d): print("Syntax error:", d, "in path", id, "\n", file=sys.stderr) quit() - def process_svg_paths(self, svg): - self.op.reset() - for path in re.findall(']+>', svg): - id = "" - m = re.search(' id="(.*)"', path) - if m: - id = m[1] + def find_attr(attrs, what): + for attr, value in attrs: + if attr == what: + return value - m = re.search(' transform="(.*)"', path) - if m: + def layer_matches(self): + """ Are we in the correct layer?""" + if not self.args.layer: + return True + for l in self.groups: + if l and l.find(self.args.layer) != -1: + return True + return False + + def handle_starttag(self, tag, attrs): + self.tags.append(tag) + if tag == 'svg': + self.viewbox = SVGParser.find_attr(attrs, 'viewbox') + if tag == 'g': + label = SVGParser.find_attr(attrs, 'inkscape:label') + self.groups.append(label) + if label and self.layer_matches(): + print("Reading layer:", label, file=sys.stderr) + if tag == 'path' and self.layer_matches(): + id = SVGParser.find_attr(attrs, 'id') + transform = SVGParser.find_attr(attrs, 'transform') + if transform: print("Found transform in path", id, "! Cannot process file!", file=sys.stderr) quit() - - m = re.search(' d="(.*)"', path) - if m: - self.process_svg_path_data(id, m[1]) - self.op.path_finished(id) - self.reset() + d = SVGParser.find_attr(attrs, 'd') + if d: + self.process_svg_path_data(id, d) + if self.op: + self.op.path_finished(id) + self.restart() + + def handle_endtag(self, tag): + if tag == 'g': + self.groups.pop() + if tag != self.tags.pop(): + print("Error popping tag off list") if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("filename") + parser.add_argument('--layer', help='only include layers which have this string in their names') args = parser.parse_args() f = open(args.filename, "r") data = f.read() - print(header) + # First pass to grab viewbox + p = SVGParser(args) + p.feed(data) b = ComputeBoundingBox() - if not b.from_svg_view_box(data): + if not b.from_svg_view_box(p.viewbox): # Can't find the view box, so use the bounding box of the elements themselves. - p = Parser(b) - p.process_svg_paths(data) - b.write() + p = SVGParser(args) + p.set_consumer(b) + p.feed(data) + b.write() + # Last pass to process paths w = WriteDataStructure(b) - p = Parser(w) - p.process_svg_paths(data) + p = SVGParser(args) + p.set_consumer(w) + p.feed(data) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp index ab6d8a89024d..c894d017ebcd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp @@ -174,11 +174,11 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) { case 1: // On Cancel, reload saved mesh, discarding changes GOTO_PREVIOUS(); - injectCommands(F("G29 L1")); + injectCommands(F(TERN(AUTO_BED_LEVELING_UBL, "G29 L1", "M501"))); return true; case 2: saveAdjustedHighlightedValue(); - injectCommands(F("G29 S1")); + injectCommands(F(TERN(AUTO_BED_LEVELING_UBL, "G29 S1", "M500"))); mydata.needSave = false; return true; case 3: @@ -191,7 +191,7 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) { void BedMeshEditScreen::show() { // On entry, always home (to account for possible Z offset changes) and save current mesh - SpinnerDialogBox::enqueueAndWait(F("G28\nG29 S1")); + SpinnerDialogBox::enqueueAndWait(F("G28\n" TERN(AUTO_BED_LEVELING_UBL, "G29 S1", "M500"))); // After the spinner, go to this screen. current_screen.forget(); PUSH_SCREEN(BedMeshEditScreen); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp index 86eab54d85b1..c42d83420f2c 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp @@ -53,10 +53,7 @@ constexpr static float gaugeThickness = 0.25; #endif static float meshGetter(uint8_t x, uint8_t y, void*) { - xy_uint8_t pos; - pos.x = x; - pos.y = y; - return ExtUI::getMeshPoint(pos); + return ExtUI::getMeshPoint(xy_uint8_t(x, y)); } void BedMeshViewScreen::onEntry() { @@ -158,7 +155,7 @@ void BedMeshViewScreen::doProbe() { } void BedMeshViewScreen::show() { - injectCommands(F("G29 L1")); + TERN_(AUTO_BED_LEVELING_UBL, injectCommands(F("G29 L1"))); GOTO_SCREEN(BedMeshViewScreen); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp index 001f97490b1d..dcf4789593b7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp @@ -43,7 +43,7 @@ void MainMenu::onRedraw(draw_mode_t what) { #define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1) #if ENABLED(CUSTOM_MENU_MAIN) #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(1,1) - #define CUSTOM_MENU_POS BTN_POS(2,3), BTN_SIZE(1,1) + #define CUSTOM_MENU_POS BTN_POS(2,3), BTN_SIZE(1,1) #else #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(2,1) #endif @@ -66,7 +66,7 @@ void MainMenu::onRedraw(draw_mode_t what) { #if ENABLED(CUSTOM_MENU_MAIN) #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(2,1) #define FILAMENTCHANGE_POS BTN_POS(3,4), BTN_SIZE(2,1) - #define CUSTOM_MENU_POS BTN_POS(5,4), BTN_SIZE(2,1) + #define CUSTOM_MENU_POS BTN_POS(5,4), BTN_SIZE(2,1) #else #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(3,1) #define FILAMENTCHANGE_POS BTN_POS(4,4), BTN_SIZE(3,1) @@ -92,7 +92,7 @@ void MainMenu::onRedraw(draw_mode_t what) { .tag( 9).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(10).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) #if ENABLED(CUSTOM_MENU_MAIN) - .tag(11).button(CUSTOM_MENU_POS, GET_TEXT_F(MSG_CUSTOM_COMMANDS)) + .tag(11).button(CUSTOM_MENU_POS, GET_TEXT_F(MSG_CUSTOM_COMMANDS)) #endif .colors(action_btn) .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); @@ -103,22 +103,30 @@ bool MainMenu::onTouchEnd(uint8_t tag) { using namespace ExtUI; switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; - case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break; + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break; #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 3: injectCommands(F("G12")); GOTO_SCREEN(StatusScreen); break; + case 3: + injectCommands(F("G12")); + GOTO_SCREEN(StatusScreen); break; #endif - case 4: GOTO_SCREEN(MoveAxisScreen); break; - case 5: injectCommands(F("M84")); break; - case 6: GOTO_SCREEN(TemperatureScreen); break; - case 7: GOTO_SCREEN(ChangeFilamentScreen); break; - case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; + case 4: GOTO_SCREEN(MoveAxisScreen); break; + case 5: + injectCommands(F("M84 E" + TERN_(DISABLE_INACTIVE_X, " X") + TERN_(DISABLE_INACTIVE_Y, " Y") + TERN_(DISABLE_INACTIVE_Z, " Z") + )); + break; + case 6: GOTO_SCREEN(TemperatureScreen); break; + case 7: GOTO_SCREEN(ChangeFilamentScreen); break; + case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; #if HAS_LEVELING - case 9: GOTO_SCREEN(LevelingMenu); break; + case 9: GOTO_SCREEN(LevelingMenu); break; #endif - case 10: GOTO_SCREEN(AboutScreen); break; + case 10: GOTO_SCREEN(AboutScreen); break; #if ENABLED(CUSTOM_MENU_MAIN) - case 11: GOTO_SCREEN(CustomUserMenus); break; + case 11: GOTO_SCREEN(CustomUserMenus); break; #endif default: diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index 738d8ee64f2e..ea484344bd40 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -376,10 +376,10 @@ void StatusScreen::loadBitmaps() { // Load the bitmaps for the status screen using namespace Theme; constexpr uint32_t base = ftdi_memory_map::RAM_G; - CLCD::mem_write_pgm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); - CLCD::mem_write_pgm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); - CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); - CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); + CLCD::mem_write_xbm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); + CLCD::mem_write_xbm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); + CLCD::mem_write_xbm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); + CLCD::mem_write_xbm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); // Load fonts for internationalization #if ENABLED(TOUCH_UI_USE_UTF8) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp index 2dbf2d9f06a7..04eb2acec6bc 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp @@ -66,7 +66,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { #if HAS_HEATED_CHAMBER w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER)); #endif - #if HAS_FAN + #if HAS_FAN0 w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT)); w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0)); #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h index db37ccfd22e4..6deb5b47587e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h @@ -171,8 +171,6 @@ namespace Language_en { LSTR MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; LSTR MSG_PREHEAT_FINISHED = u8"Preheat finished"; LSTR MSG_PREHEAT = u8"Preheat"; - LSTR MSG_BUTTON_PAUSE = u8"Pause"; - LSTR MSG_BUTTON_RESUME = u8"Resume"; LSTR MSG_ELAPSED_PRINT = u8"Elapsed Print"; LSTR MSG_XYZ_MOVE = u8"XYZ Move"; LSTR MSG_E_MOVE = u8"Extrusion Move"; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h index 48a0c1a96440..7b0a0d25e9aa 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h @@ -62,9 +62,11 @@ union screen_data_t { DECL_DATA_IF_INCLUDED(FTDI_Z_OFFSET_SCREEN) DECL_DATA_IF_INCLUDED(FTDI_BASE_NUMERIC_ADJ_SCREEN) DECL_DATA_IF_INCLUDED(FTDI_ALERT_DIALOG_BOX) + DECL_DATA_IF_INCLUDED(COCOA_STATUS_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_PREHEAT_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_LOAD_CHOCOLATE_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_FILES_SCREEN) + DECL_DATA_IF_INCLUDED(COCOA_Z_OFFSET_WIZARD) }; extern screen_data_t screen_data; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp index ed210369c4f2..c7607f71d071 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp @@ -118,6 +118,10 @@ SCREEN_TABLE { DECL_SCREEN_IF_INCLUDED(COCOA_MOVE_E_SCREEN) DECL_SCREEN_IF_INCLUDED(COCOA_CONFIRM_START_PRINT) DECL_SCREEN_IF_INCLUDED(COCOA_FILES_SCREEN) + DECL_SCREEN_IF_INCLUDED(COCOA_Z_OFFSET_SCREEN) + DECL_SCREEN_IF_INCLUDED(COCOA_Z_OFFSET_WIZARD) + DECL_SCREEN_IF_INCLUDED(COCOA_ABOUT_SCREEN) + DECL_SCREEN_IF_INCLUDED(COCOA_STATISTICS_SCREEN) }; SCREEN_TABLE_POST diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h index c194225d99ae..a2729979c6bf 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h @@ -37,25 +37,25 @@ namespace Theme { }; constexpr PROGMEM unsigned char Extruder_Icon[69] = { - 0x3F, 0xFF, 0xFC, - 0x7F, 0xFF, 0xFE, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0x7F, 0xFF, 0xFE, - 0x3F, 0xFF, 0xFC, - 0x3F, 0xFF, 0xFC, - 0x7F, 0xFF, 0xFE, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0x7F, 0xFF, 0xFE, - 0x7F, 0xFF, 0xFE, - 0x07, 0xFF, 0xE0, - 0x03, 0xFF, 0xC0, - 0x01, 0x81, 0x80, + 0xFC, 0xFF, 0x3F, + 0xFE, 0xFF, 0x7F, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0xFE, 0xFF, 0x7F, + 0xFC, 0xFF, 0x3F, + 0xFC, 0xFF, 0x3F, + 0xFE, 0xFF, 0x7F, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0xFE, 0xFF, 0x7F, + 0xFE, 0xFF, 0x7F, + 0xE0, 0xFF, 0x07, + 0xC0, 0xFF, 0x03, + 0x80, 0x81, 0x01, 0x00, 0xC3, 0x00, 0x00, 0x66, 0x00, 0x00, 0x3C, 0x00, @@ -74,28 +74,28 @@ namespace Theme { }; constexpr PROGMEM unsigned char Bed_Heat_Icon[92] = { - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0x60, 0x60, 0x60, - 0x00, 0x60, 0x60, 0x60, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0xC0, 0xC0, 0xC0, - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x03, 0x03, 0x03, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x06, 0x06, 0x06, 0x00, - 0x06, 0x06, 0x06, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, + 0x80, 0x81, 0x81, 0x01, + 0x80, 0x81, 0x81, 0x01, + 0x00, 0x03, 0x03, 0x03, + 0x00, 0x03, 0x03, 0x03, + 0x00, 0x06, 0x06, 0x06, + 0x00, 0x06, 0x06, 0x06, + 0x00, 0x03, 0x03, 0x03, + 0x00, 0x03, 0x03, 0x03, + 0x80, 0x81, 0x81, 0x01, + 0x80, 0x81, 0x81, 0x01, + 0xC0, 0xC0, 0xC0, 0x00, + 0xC0, 0xC0, 0xC0, 0x00, + 0x60, 0x60, 0x60, 0x00, + 0x60, 0x60, 0x60, 0x00, + 0xC0, 0xC0, 0xC0, 0x00, + 0xC0, 0xC0, 0xC0, 0x00, + 0x80, 0x81, 0x81, 0x01, + 0x80, 0x81, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xC0, 0x00, 0x00, 0x03, + 0x03, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF }; @@ -113,34 +113,34 @@ namespace Theme { constexpr PROGMEM unsigned char Fan_Icon[128] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xF8, 0x00, 0x00, 0x1F, - 0xF0, 0x03, 0xF8, 0x0F, - 0xE0, 0x07, 0xF0, 0x07, - 0xC0, 0x0F, 0xE0, 0x03, - 0xC0, 0x1F, 0xE0, 0x03, - 0xC0, 0x1F, 0xE0, 0x03, - 0xC0, 0x0F, 0xE0, 0x03, - 0xC0, 0x07, 0xE0, 0x03, - 0xC0, 0x03, 0xC0, 0x03, - 0xD0, 0x00, 0x00, 0xC3, - 0xD8, 0x03, 0xC1, 0xE3, - 0xDF, 0xC7, 0xE3, 0xF3, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0x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, 0xFF, 0xFF, 0xFF, 0xFF }; @@ -157,26 +157,26 @@ namespace Theme { }; constexpr PROGMEM unsigned char TD_Icon[140] = { - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, // Thumb Drive Widget - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00 + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, // Thumb Drive Widget + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01, + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, 0x00 }; constexpr PROGMEM bitmap_info_t File_Icon_Info = { @@ -191,17 +191,17 @@ namespace Theme { }; const unsigned char File_Icon[128] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, - 0x40, 0x02, 0x80, 0x00, 0x40, 0x02, 0x40, 0x00, 0x40, 0x02, 0x20, 0x00, - 0x40, 0x02, 0x10, 0x00, 0x40, 0x02, 0x08, 0x00, 0x40, 0x02, 0x04, 0x00, - 0x40, 0x02, 0x02, 0x00, 0x40, 0x03, 0xFF, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x02, 0xC0, 0x00, 0x00, + 0x02, 0x40, 0x01, 0x00, 0x02, 0x40, 0x02, 0x00, 0x02, 0x40, 0x04, 0x00, + 0x02, 0x40, 0x08, 0x00, 0x02, 0x40, 0x10, 0x00, 0x02, 0x40, 0x20, 0x00, + 0x02, 0x40, 0x40, 0x00, 0x02, 0xC0, 0xFF, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 }; constexpr PROGMEM bitmap_info_t Clock_Icon_Info = { @@ -216,17 +216,17 @@ namespace Theme { }; const unsigned char Clock_Icon[128] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x7E, 0x7E, 0x00, - 0x00, 0xE0, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x07, 0x01, 0x00, 0xE0, - 0x0C, 0x01, 0x80, 0x70, 0x0C, 0x01, 0x80, 0x30, 0x18, 0x01, 0x80, 0x18, - 0x30, 0x01, 0x80, 0x08, 0x30, 0x01, 0x80, 0x0C, 0x20, 0x01, 0x80, 0x0C, - 0x60, 0x01, 0x80, 0x04, 0x60, 0x01, 0x80, 0x06, 0x60, 0x01, 0x80, 0x06, - 0x60, 0x01, 0xFF, 0x06, 0x60, 0x01, 0xFF, 0x06, 0x60, 0x00, 0x00, 0x06, - 0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x0C, - 0x30, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00, 0x18, - 0x0C, 0x00, 0x00, 0x30, 0x0E, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0xE0, - 0x03, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x7F, 0xFE, 0x00, - 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x7E, 0x7E, 0x00, + 0x00, 0x07, 0xE0, 0x00, 0xC0, 0x01, 0x80, 0x03, 0xE0, 0x80, 0x00, 0x07, + 0x30, 0x80, 0x01, 0x0E, 0x30, 0x80, 0x01, 0x0C, 0x18, 0x80, 0x01, 0x18, + 0x0C, 0x80, 0x01, 0x10, 0x0C, 0x80, 0x01, 0x30, 0x04, 0x80, 0x01, 0x30, + 0x06, 0x80, 0x01, 0x20, 0x06, 0x80, 0x01, 0x60, 0x06, 0x80, 0x01, 0x60, + 0x06, 0x80, 0xFF, 0x60, 0x06, 0x80, 0xFF, 0x60, 0x06, 0x00, 0x00, 0x60, + 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x30, + 0x0C, 0x00, 0x00, 0x30, 0x0C, 0x00, 0x00, 0x10, 0x18, 0x00, 0x00, 0x18, + 0x30, 0x00, 0x00, 0x0C, 0x70, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x07, + 0xC0, 0x01, 0x80, 0x03, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFE, 0x7F, 0x00, + 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00 }; constexpr PROGMEM bitmap_info_t Light_Bulb_Info = { @@ -241,17 +241,42 @@ namespace Theme { }; const unsigned char Light_Bulb[128] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, - 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, - 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x36, 0x18, 0x00, - 0x00, 0x2C, 0x08, 0x00, 0x00, 0x58, 0x04, 0x00, 0x00, 0x50, 0x04, 0x00, - 0x7C, 0x50, 0x04, 0x7C, 0x00, 0x40, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, - 0x00, 0x60, 0x0C, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, - 0x00, 0x10, 0x10, 0x00, 0x00, 0x88, 0x22, 0x00, 0x01, 0x08, 0x21, 0x00, - 0x02, 0x08, 0x20, 0x80, 0x04, 0x0F, 0xE0, 0x40, 0x00, 0x07, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, + 0x40, 0x00, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01, 0x40, 0x00, + 0x00, 0xF0, 0x07, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x6C, 0x18, 0x00, + 0x00, 0x34, 0x10, 0x00, 0x00, 0x1A, 0x20, 0x00, 0x00, 0x0A, 0x20, 0x00, + 0x3E, 0x0A, 0x20, 0x3E, 0x00, 0x02, 0x20, 0x00, 0x00, 0x02, 0x20, 0x00, + 0x00, 0x06, 0x30, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, + 0x00, 0x08, 0x08, 0x00, 0x00, 0x11, 0x44, 0x00, 0x80, 0x10, 0x84, 0x00, + 0x40, 0x10, 0x04, 0x01, 0x20, 0xF0, 0x07, 0x02, 0x00, 0xE0, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + constexpr PROGMEM bitmap_info_t Chamber_Icon_Info = { + .format = L1, + .linestride = 4, + .filter = BILINEAR, + .wrapx = BORDER, + .wrapy = BORDER, + .RAMG_offset = 8813, + .width = 32, + .height = 32, + }; + + const unsigned char Chamber_Icon[128] PROGMEM = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, + 0x0F, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xC0, + 0x03, 0x00, 0x00, 0xC0, 0x83, 0x81, 0x81, 0xC1, 0x83, 0x81, 0x81, 0xC1, + 0x03, 0x03, 0x03, 0xC3, 0x03, 0x03, 0x03, 0xC3, 0x03, 0x06, 0x06, 0xC6, + 0x03, 0x06, 0x06, 0xC6, 0x03, 0x03, 0x03, 0xC3, 0x03, 0x03, 0x03, 0xC3, + 0x83, 0x81, 0x81, 0xC1, 0x83, 0x81, 0x81, 0xC1, 0xC3, 0xC0, 0xC0, 0xC0, + 0xC3, 0xC0, 0xC0, 0xC0, 0x63, 0x60, 0x60, 0xC0, 0x63, 0x60, 0x60, 0xC0, + 0xC3, 0xC0, 0xC0, 0xC0, 0xC3, 0xC0, 0xC0, 0xC0, 0x83, 0x81, 0x81, 0xC1, + 0x83, 0x81, 0x81, 0xC1, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0, + 0x07, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0xF8, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp index efeed1920114..d8407406a1eb 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp @@ -300,6 +300,44 @@ namespace Theme { {SILENCE, END_SONG, 0} }; + const PROGMEM SoundPlayer::sound_t flagpole[] = { + {TRIANGLE_WAVE, NOTE_G3, 2}, + {TRIANGLE_WAVE, NOTE_C4, 2}, + {TRIANGLE_WAVE, NOTE_E4, 2}, + {TRIANGLE_WAVE, NOTE_G4, 2}, + {TRIANGLE_WAVE, NOTE_C5, 2}, + {TRIANGLE_WAVE, NOTE_E5, 2}, + {TRIANGLE_WAVE, NOTE_G5, 5}, + {TRIANGLE_WAVE, NOTE_E5, 2}, + + {TRIANGLE_WAVE, NOTE_G3S, 2}, + {TRIANGLE_WAVE, NOTE_C4, 2}, + {TRIANGLE_WAVE, NOTE_D4S, 2}, + {TRIANGLE_WAVE, NOTE_G4S, 2}, + {TRIANGLE_WAVE, NOTE_C5, 2}, + {TRIANGLE_WAVE, NOTE_D5S, 2}, + {TRIANGLE_WAVE, NOTE_G5S, 5}, + {TRIANGLE_WAVE, NOTE_D5S, 5}, + + {TRIANGLE_WAVE, NOTE_A3S, 2}, + {TRIANGLE_WAVE, NOTE_D4, 2}, + {TRIANGLE_WAVE, NOTE_F4, 2}, + {TRIANGLE_WAVE, NOTE_A4S, 2}, + {TRIANGLE_WAVE, NOTE_D5, 2}, + {TRIANGLE_WAVE, NOTE_F5, 2}, + {TRIANGLE_WAVE, NOTE_A5S, 5}, + + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 1}, + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 1}, + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 1}, + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 8}, + {SILENCE, END_SONG, 0} + }; + const PROGMEM SoundPlayer::sound_t big_band[] = { {XYLOPHONE, NOTE_F4, 3}, {XYLOPHONE, NOTE_G4, 3}, @@ -402,7 +440,8 @@ const SoundList::list_t SoundList::list[] = { {"Carousel", Theme::carousel}, {"Beats", Theme::beats}, {"Bach Joy", Theme::js_bach_joy}, - {"Bach Toccata", Theme::js_bach_toccata} + {"Bach Toccata", Theme::js_bach_toccata}, + {"Flagpole", Theme::flagpole} }; const uint8_t SoundList::n = N_ELEMENTS(SoundList::list); diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 6246b9f00291..fdb068d32f38 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -688,7 +688,9 @@ void RTS::handleData() { return; } - constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; + #if ENABLED(LCD_BED_TRAMMING) + constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; + #endif switch (Checkkey) { case Printfile: @@ -785,26 +787,30 @@ void RTS::handleData() { } break; - case Zoffset: - float tmp_zprobe_offset; - if (recdat.data[0] >= 32768) - tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; - else - tmp_zprobe_offset = float(recdat.data[0]) / 100; - 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)); - if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; - smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); - } - else { - onStatusChanged(F("Requested Offset Beyond Limits")); - } + #if HAS_BED_PROBE - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - break; + case Zoffset: + float tmp_zprobe_offset; + if (recdat.data[0] >= 32768) + tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; + else + tmp_zprobe_offset = float(recdat.data[0]) / 100; + 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)); + if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; + smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); + char zOffs[20], tmp1[11]; + sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); + onStatusChanged(zOffs); + } + else { + onStatusChanged(F("Requested Offset Beyond Limits")); + } + + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + break; + + #endif // HAS_BED_PROBE case TempControl: if (recdat.data[0] == 0) { @@ -1106,29 +1112,31 @@ void RTS::handleData() { sendData(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); - //setZOffset_mm(getZOffset_mm() + 0.1); - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); + + #if HAS_BED_PROBE + + 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); + //setZOffset_mm(getZOffset_mm() + 0.1); + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3))); + } + break; } - break; - } - 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, axis_t(Z), false); - //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); - //setZOffset_mm(getZOffset_mm() - 0.1); - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); + 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, axis_t(Z), false); + //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); + //setZOffset_mm(getZOffset_mm() - 0.1); + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3))); + } + break; } - break; - } + + #endif // HAS_BED_PROBE + case 4: { // Assistant Level TERN_(HAS_MESH, setLevelingActive(false)); injectCommands(isPositionKnown() ? F("G1 F1000 Z0.0") : F("G28\nG1 F1000 Z0.0")); @@ -1140,7 +1148,7 @@ void RTS::handleData() { #if ENABLED(MESH_BED_LEVELING) sendData(ExchangePageBase + 93, ExchangepageAddr); #else - waitway = 3; // only for prohibiting to receive massage + waitway = 3; // Only for prohibiting to receive message sendData(3, AutolevelIcon); uint8_t abl_probe_index = 0; while (abl_probe_index < 25) { @@ -1153,65 +1161,74 @@ void RTS::handleData() { break; } - 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)); - 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)); - 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)); - 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)); - 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)); - waitway = 6; - break; - } + #if ENABLED(LCD_BED_TRAMMING) + case 6: { // Bed Tramming, 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)); + waitway = 6; + break; + } + case 7: { // Bed Tramming, 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)); + waitway = 6; + break; + } + case 8: { // Bed Tramming, 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)); + waitway = 6; + break; + } + case 9: { // Bed Tramming, 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)); + waitway = 6; + break; + } + case 10: { // Bed Tramming, 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)); + waitway = 6; + break; + } + #endif // LCD_BED_TRAMMING + case 11: { // Autolevel switch #if HAS_MESH const bool gla = !getLevelingActive(); setLevelingActive(gla); sendData(gla ? 3 : 2, AutoLevelIcon); #endif - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - break; - } - case 12: { - injectCommands(F("G26R255")); - onStatusChanged(F("Beginning G26.. Heating")); - break; - } - case 13: { - injectCommands(F("G29S1")); - onStatusChanged(F("Begin Manual Mesh")); - break; - } - case 14: { - injectCommands(F("G29S2")); - onStatusChanged(F("Moving to Next Mesh Point")); + #if HAS_BED_PROBE + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + #endif break; } + #if ENABLED(G26_MESH_VALIDATION) + case 12: { + injectCommands(F("G26R255")); + onStatusChanged(F("Beginning G26.. Heating")); + break; + } + #endif + #if ENABLED(MESH_BED_LEVELING) + case 13: { + injectCommands(F("G29S1")); + onStatusChanged(F("Begin Manual Mesh")); + break; + } + case 14: { + injectCommands(F("G29S2")); + onStatusChanged(F("Moving to Next Mesh Point")); + break; + } + #endif case 15: { injectCommands(F("M211S0\nG91\nG1Z-0.025\nG90\nM211S1")); onStatusChanged(F("Moved down 0.025")); @@ -1422,13 +1439,14 @@ void RTS::handleData() { break; } - case 5: { - #if ENABLED(PIDTEMPBED) + #if ENABLED(PIDTEMPBED) + case 5: { onStatusChanged(F("Bed PID Started")); startBedPIDTune(static_cast(pid_bedAutoTemp)); - #endif - break; - } + break; + } + #endif + case 6: { injectCommands(F("M500")); break; diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 328bbe24eb0a..4677d63b696c 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -235,10 +235,10 @@ void menu_advanced_settings(); #if ENABLED(DUAL_X_CARRIAGE) EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets); #else - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, -99.0, 99.0, _recalc_offsets); + EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, -99.0f, 99.0f, _recalc_offsets); #endif - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets); - EDIT_ITEM_FAST_N(float42_52, Z_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets); + EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].y, -99.0f, 99.0f, _recalc_offsets); + EDIT_ITEM_FAST_N(float42_52, Z_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].z, -10.0f, 10.0f, _recalc_offsets); #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); #endif diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index dcabb7861e51..97c5b6759847 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -319,13 +319,13 @@ void menu_move() { #include "../../gcode/gcode.h" void ftm_menu_setShaping(const ftMotionMode_t s) { - fxdTiCtrl.cfg.mode = s; - fxdTiCtrl.refreshShapingN(); + ftMotion.cfg.mode = s; + ftMotion.refreshShapingN(); ui.go_back(); } inline void menu_ftm_mode() { - const ftMotionMode_t mode = fxdTiCtrl.cfg.mode; + const ftMotionMode_t mode = ftMotion.cfg.mode; START_MENU(); BACK_ITEM(MSG_FIXED_TIME_MOTION); @@ -349,17 +349,17 @@ void menu_move() { #if HAS_DYNAMIC_FREQ inline void menu_ftm_dyn_mode() { - const dynFreqMode_t dmode = fxdTiCtrl.cfg.dynFreqMode; + const dynFreqMode_t dmode = ftMotion.cfg.dynFreqMode; START_MENU(); BACK_ITEM(MSG_FIXED_TIME_MOTION); - if (dmode != dynFreqMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_DISABLED; ui.go_back(); }); + if (dmode != dynFreqMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ ftMotion.cfg.dynFreqMode = dynFreqMode_DISABLED; ui.go_back(); }); #if HAS_DYNAMIC_FREQ_MM - if (dmode != dynFreqMode_Z_BASED) ACTION_ITEM(MSG_FTM_Z_BASED, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_Z_BASED; ui.go_back(); }); + if (dmode != dynFreqMode_Z_BASED) ACTION_ITEM(MSG_FTM_Z_BASED, []{ ftMotion.cfg.dynFreqMode = dynFreqMode_Z_BASED; ui.go_back(); }); #endif #if HAS_DYNAMIC_FREQ_G - if (dmode != dynFreqMode_MASS_BASED) ACTION_ITEM(MSG_FTM_MASS_BASED, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_MASS_BASED; ui.go_back(); }); + if (dmode != dynFreqMode_MASS_BASED) ACTION_ITEM(MSG_FTM_MASS_BASED, []{ ftMotion.cfg.dynFreqMode = dynFreqMode_MASS_BASED; ui.go_back(); }); #endif END_MENU(); @@ -368,7 +368,7 @@ void menu_move() { #endif // HAS_DYNAMIC_FREQ void menu_ft_motion() { - ft_config_t &c = fxdTiCtrl.cfg; + ft_config_t &c = ftMotion.cfg; FSTR_P ftmode; switch (c.mode) { @@ -403,16 +403,16 @@ void menu_move() { if (c.modeHasShaper()) { #if HAS_X_AXIS - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[X_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[X_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, ftMotion.refreshShapingN); #endif #if HAS_Y_AXIS - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[Y_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[Y_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, ftMotion.refreshShapingN); #endif - EDIT_ITEM_FAST(float42_52, MSG_FTM_ZETA, &c.zeta, 0.0f, 1.0f, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST(float42_52, MSG_FTM_ZETA, &c.zeta, 0.0f, 1.0f, ftMotion.refreshShapingN); if (WITHIN(c.mode, ftMotionMode_EI, ftMotionMode_3HEI)) - EDIT_ITEM_FAST(float42_52, MSG_FTM_VTOL, &c.vtol, 0.0f, 1.0f, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST(float42_52, MSG_FTM_VTOL, &c.vtol, 0.0f, 1.0f, ftMotion.refreshShapingN); #if HAS_DYNAMIC_FREQ SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode); diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 385d81622e8c..ad37e8a9b3da 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -27,7 +27,7 @@ #include "ft_motion.h" #include "stepper.h" // Access stepper block queue function and abort status. -FxdTiCtrl fxdTiCtrl; +FTMotion ftMotion; #if !HAS_X_AXIS static_assert(FTM_DEFAULT_MODE == ftMotionMode_ZV, "ftMotionMode_ZV requires at least one linear axis."); @@ -50,66 +50,67 @@ FxdTiCtrl fxdTiCtrl; // Public variables. -ft_config_t FxdTiCtrl::cfg; -ft_command_t FxdTiCtrl::stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of stepper commands. -hal_timer_t FxdTiCtrl::stepperCmdBuff_StepRelativeTi[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of the stepper command timing. -uint8_t FxdTiCtrl::stepperCmdBuff_ApplyDir[FTM_STEPPERCMD_DIR_SIZE] = {0U}; // Buffer of whether DIR needs to be updated. -uint32_t FxdTiCtrl::stepperCmdBuff_produceIdx = 0, // Index of next stepper command write to the buffer. - FxdTiCtrl::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer. +ft_config_t FTMotion::cfg; +bool FTMotion::busy; // = false +ft_command_t FTMotion::stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of stepper commands. +hal_timer_t FTMotion::stepperCmdBuff_StepRelativeTi[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of the stepper command timing. +uint8_t FTMotion::stepperCmdBuff_ApplyDir[FTM_STEPPERCMD_DIR_SIZE] = {0U}; // Buffer of whether DIR needs to be updated. +uint32_t FTMotion::stepperCmdBuff_produceIdx = 0, // Index of next stepper command write to the buffer. + FTMotion::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer. -bool FxdTiCtrl::sts_stepperBusy = false; // The stepper buffer has items and is in use. +bool FTMotion::sts_stepperBusy = false; // The stepper buffer has items and is in use. // Private variables. // NOTE: These are sized for Ulendo FBS use. -xyze_trajectory_t FxdTiCtrl::traj; // = {0.0f} Storage for fixed-time-based trajectory. -xyze_trajectoryMod_t FxdTiCtrl::trajMod; // = {0.0f} Storage for modified fixed-time-based trajectory. - -block_t* FxdTiCtrl::current_block_cpy = nullptr; // Pointer to current block being processed. -bool FxdTiCtrl::blockProcRdy = false, // Indicates a block is ready to be processed. - FxdTiCtrl::blockProcRdy_z1 = false, // Storage for the previous indicator. - FxdTiCtrl::blockProcDn = false; // Indicates current block is done being processed. -bool FxdTiCtrl::batchRdy = false; // Indicates a batch of the fixed time trajectory - // has been generated, is now available in the upper - - // half of traj.x[], y, z ... e vectors, and is ready to be - // post processed, if applicable, then interpolated. -bool FxdTiCtrl::batchRdyForInterp = false; // Indicates the batch is done being post processed, - // if applicable, and is ready to be converted to step commands. -bool FxdTiCtrl::runoutEna = false; // True if runout of the block hasn't been done and is allowed. -bool FxdTiCtrl::runout = false; // Indicates if runout is in progress. +xyze_trajectory_t FTMotion::traj; // = {0.0f} Storage for fixed-time-based trajectory. +xyze_trajectoryMod_t FTMotion::trajMod; // = {0.0f} Storage for modified fixed-time-based trajectory. + +block_t* FTMotion::current_block_cpy = nullptr; // Pointer to current block being processed. +bool FTMotion::blockProcRdy = false, // Indicates a block is ready to be processed. + FTMotion::blockProcRdy_z1 = false, // Storage for the previous indicator. + FTMotion::blockProcDn = false; // Indicates current block is done being processed. +bool FTMotion::batchRdy = false; // Indicates a batch of the fixed time trajectory + // has been generated, is now available in the upper - + // half of traj.x[], y, z ... e vectors, and is ready to be + // post processed, if applicable, then interpolated. +bool FTMotion::batchRdyForInterp = false; // Indicates the batch is done being post processed, + // if applicable, and is ready to be converted to step commands. +bool FTMotion::runoutEna = false; // True if runout of the block hasn't been done and is allowed. +bool FTMotion::runout = false; // Indicates if runout is in progress. // Trapezoid data variables. -xyze_pos_t FxdTiCtrl::startPosn, // (mm) Start position of block - FxdTiCtrl::endPosn_prevBlock = { 0.0f }; // (mm) End position of previous block -xyze_float_t FxdTiCtrl::ratio; // (ratio) Axis move ratio of block -float FxdTiCtrl::accel_P, // Acceleration prime of block. [mm/sec/sec] - FxdTiCtrl::decel_P, // Deceleration prime of block. [mm/sec/sec] - FxdTiCtrl::F_P, // Feedrate prime of block. [mm/sec] - FxdTiCtrl::f_s, // Starting feedrate of block. [mm/sec] - FxdTiCtrl::s_1e, // Position after acceleration phase of block. - FxdTiCtrl::s_2e; // Position after acceleration and coasting phase of block. - -uint32_t FxdTiCtrl::N1, // Number of data points in the acceleration phase. - FxdTiCtrl::N2, // Number of data points in the coasting phase. - FxdTiCtrl::N3; // Number of data points in the deceleration phase. - -uint32_t FxdTiCtrl::max_intervals; // Total number of data points that will be generated from block. +xyze_pos_t FTMotion::startPosn, // (mm) Start position of block + FTMotion::endPosn_prevBlock = { 0.0f }; // (mm) End position of previous block +xyze_float_t FTMotion::ratio; // (ratio) Axis move ratio of block +float FTMotion::accel_P, // Acceleration prime of block. [mm/sec/sec] + FTMotion::decel_P, // Deceleration prime of block. [mm/sec/sec] + FTMotion::F_P, // Feedrate prime of block. [mm/sec] + FTMotion::f_s, // Starting feedrate of block. [mm/sec] + FTMotion::s_1e, // Position after acceleration phase of block. + FTMotion::s_2e; // Position after acceleration and coasting phase of block. + +uint32_t FTMotion::N1, // Number of data points in the acceleration phase. + FTMotion::N2, // Number of data points in the coasting phase. + FTMotion::N3; // Number of data points in the deceleration phase. + +uint32_t FTMotion::max_intervals; // Total number of data points that will be generated from block. // Make vector variables. -uint32_t FxdTiCtrl::makeVector_idx = 0, // Index of fixed time trajectory generation of the overall block. - FxdTiCtrl::makeVector_idx_z1 = 0, // Storage for the previously calculated index above. - FxdTiCtrl::makeVector_batchIdx = FTM_BATCH_SIZE; // Index of fixed time trajectory generation within the batch. +uint32_t FTMotion::makeVector_idx = 0, // Index of fixed time trajectory generation of the overall block. + FTMotion::makeVector_idx_z1 = 0, // Storage for the previously calculated index above. + FTMotion::makeVector_batchIdx = FTM_BATCH_SIZE; // Index of fixed time trajectory generation within the batch. // Interpolation variables. -xyze_long_t FxdTiCtrl::steps = { 0 }; // Step count accumulator. -xyze_stepDir_t FxdTiCtrl::dirState = LOGICAL_AXIS_ARRAY_1(stepDirState_NOT_SET); // Memory of the currently set step direction of the axis. +xyze_long_t FTMotion::steps = { 0 }; // Step count accumulator. +xyze_stepDir_t FTMotion::dirState = LOGICAL_AXIS_ARRAY_1(stepDirState_NOT_SET); // Memory of the currently set step direction of the axis. -uint32_t FxdTiCtrl::interpIdx = 0, // Index of current data point being interpolated. - FxdTiCtrl::interpIdx_z1 = 0; // Storage for the previously calculated index above. -hal_timer_t FxdTiCtrl::nextStepTicks = FTM_MIN_TICKS; // Accumulator for the next step time (in ticks). +uint32_t FTMotion::interpIdx = 0, // Index of current data point being interpolated. + FTMotion::interpIdx_z1 = 0; // Storage for the previously calculated index above. +hal_timer_t FTMotion::nextStepTicks = FTM_MIN_TICKS; // Accumulator for the next step time (in ticks). // Shaping variables. #if HAS_X_AXIS - FxdTiCtrl::shaping_t FxdTiCtrl::shaping = { + FTMotion::shaping_t FTMotion::shaping = { 0, 0, x:{ { 0.0f }, { 0.0f }, { 0 } }, // d_zi, Ai, Ni #if HAS_Y_AXIS @@ -120,8 +121,8 @@ hal_timer_t FxdTiCtrl::nextStepTicks = FTM_MIN_TICKS; // Accumulator for the nex #if HAS_EXTRUDERS // Linear advance variables. - float FxdTiCtrl::e_raw_z1 = 0.0f; // (ms) Unit delay of raw extruder position. - float FxdTiCtrl::e_advanced_z1 = 0.0f; // (ms) Unit delay of advanced extruder position. + float FTMotion::e_raw_z1 = 0.0f; // (ms) Unit delay of raw extruder position. + float FTMotion::e_advanced_z1 = 0.0f; // (ms) Unit delay of advanced extruder position. #endif constexpr uint32_t last_batchIdx = (FTM_WINDOW_SIZE) - (FTM_BATCH_SIZE); @@ -133,15 +134,15 @@ constexpr uint32_t last_batchIdx = (FTM_WINDOW_SIZE) - (FTM_BATCH_SIZE); // Public functions. // Sets controller states to begin processing a block. -void FxdTiCtrl::startBlockProc(block_t * const current_block) { +void FTMotion::startBlockProc(block_t * const current_block) { current_block_cpy = current_block; blockProcRdy = true; blockProcDn = false; runoutEna = true; } -// Moves any free data points to the stepper buffer even if a full batch isn't ready. -void FxdTiCtrl::runoutBlock() { +// Move any free data points to the stepper buffer even if a full batch isn't ready. +void FTMotion::runoutBlock() { if (runoutEna && !batchRdy) { // If the window is full already (block intervals was a multiple of // the batch size), or runout is not enabled, no runout is needed. @@ -170,7 +171,7 @@ void FxdTiCtrl::runoutBlock() { } // Controller main, to be invoked from non-isr task. -void FxdTiCtrl::loop() { +void FTMotion::loop() { if (!cfg.mode) return; @@ -188,7 +189,7 @@ void FxdTiCtrl::loop() { } // Planner processing and block conversion. - if (!blockProcRdy && !runout) stepper.fxdTiCtrl_BlockQueueUpdate(); + if (!blockProcRdy && !runout) stepper.ftMotion_BlockQueueUpdate(); if (blockProcRdy) { if (!blockProcRdy_z1) loadBlockData(current_block_cpy); // One-shot. @@ -264,7 +265,7 @@ void FxdTiCtrl::loop() { } // Report busy status to planner. - planner.fxdTiCtrl_busy = (sts_stepperBusy || ((!blockProcDn && blockProcRdy) || batchRdy || batchRdyForInterp || runoutEna)); + busy = (sts_stepperBusy || ((!blockProcDn && blockProcRdy) || batchRdy || batchRdyForInterp || runoutEna)); blockProcRdy_z1 = blockProcRdy; makeVector_idx_z1 = makeVector_idx; @@ -276,7 +277,7 @@ void FxdTiCtrl::loop() { // Refresh the gains used by shaping functions. // To be called on init or mode or zeta change. - void FxdTiCtrl::Shaping::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { + void FTMotion::Shaping::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { const float K = exp(-zeta * M_PI / sqrt(1.0f - sq(zeta))), K2 = sq(K); @@ -345,14 +346,14 @@ void FxdTiCtrl::loop() { #endif } - void FxdTiCtrl::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { + void FTMotion::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { shaping.updateShapingA(zeta, vtol); } // Refresh the indices used by shaping functions. // To be called when frequencies change. - void FxdTiCtrl::AxisShaping::updateShapingN(const_float_t f, const_float_t df) { + void FTMotion::AxisShaping::updateShapingN(const_float_t f, const_float_t df) { // Protections omitted for DBZ and for index exceeding array length. switch (cfg.mode) { case ftMotionMode_ZV: @@ -382,7 +383,7 @@ void FxdTiCtrl::loop() { } } - void FxdTiCtrl::updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta/*=cfg.zeta*/) { + void FTMotion::updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta/*=cfg.zeta*/) { const float df = sqrt(1.0f - sq(zeta)); shaping.x.updateShapingN(xf, df); TERN_(HAS_Y_AXIS, shaping.y.updateShapingN(yf, df)); @@ -391,12 +392,12 @@ void FxdTiCtrl::loop() { #endif // HAS_X_AXIS // Reset all trajectory processing variables. -void FxdTiCtrl::reset() { +void FTMotion::reset() { stepperCmdBuff_produceIdx = stepperCmdBuff_consumeIdx = 0; - traj.reset(); // Reset trajectory history - trajMod.reset(); // Reset modified trajectory history + traj.reset(); // Reset trajectory history + trajMod.reset(); // Reset modified trajectory history blockProcRdy = blockProcRdy_z1 = blockProcDn = false; batchRdy = batchRdyForInterp = false; @@ -424,13 +425,13 @@ void FxdTiCtrl::reset() { // Private functions. // Auxiliary function to get number of step commands in the buffer. -uint32_t FxdTiCtrl::stepperCmdBuffItems() { +uint32_t FTMotion::stepperCmdBuffItems() { const uint32_t udiff = stepperCmdBuff_produceIdx - stepperCmdBuff_consumeIdx; return stepperCmdBuff_produceIdx < stepperCmdBuff_consumeIdx ? (FTM_STEPPERCMD_BUFF_SIZE) + udiff : udiff; } // Initializes storage variables before startup. -void FxdTiCtrl::init() { +void FTMotion::init() { #if HAS_X_AXIS refreshShapingN(); updateShapingA(); @@ -439,7 +440,7 @@ void FxdTiCtrl::init() { } // Loads / converts block data from planner to fixed-time control variables. -void FxdTiCtrl::loadBlockData(block_t * const current_block) { +void FTMotion::loadBlockData(block_t * const current_block) { const float totalLength = current_block->millimeters, oneOverLength = 1.0f / totalLength; @@ -489,6 +490,7 @@ void FxdTiCtrl::loadBlockData(block_t * const current_block) { const float fdiff = feSqByTwoD - fsSqByTwoA, // (mm) Coasting distance if nominal speed is reached odiff = oneby2a - oneby2d, // (i.e., oneby2a * 2) (mm/s) Change in speed for one second of acceleration ldiff = totalLength - fdiff; // (mm) Distance to travel if nominal speed is reached + float T2 = (1.0f / F_n) * (ldiff - odiff * sq(F_n)); // (s) Coasting duration after nominal speed reached if (T2 < 0.0f) { T2 = 0.0f; @@ -536,7 +538,7 @@ void FxdTiCtrl::loadBlockData(block_t * const current_block) { } // Generate data points of the trajectory. -void FxdTiCtrl::makeVector() { +void FTMotion::makeVector() { float accel_k = 0.0f; // (mm/s^2) Acceleration K factor float tau = (makeVector_idx + 1) * (FTM_TS); // (s) Time since start of block float dist = 0.0f; // (mm) Distance traveled @@ -653,7 +655,7 @@ void FxdTiCtrl::makeVector() { } // Interpolates single data point to stepper commands. -void FxdTiCtrl::convertToSteps(const uint32_t idx) { +void FTMotion::convertToSteps(const uint32_t idx) { xyze_long_t err_P = { 0 }; //#define STEPS_ROUNDING diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index d607ac103038..3f620b2f5419 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -64,12 +64,13 @@ typedef struct FTConfig { #endif } ft_config_t; -class FxdTiCtrl { +class FTMotion { public: // Public variables static ft_config_t cfg; + static bool busy; static void set_defaults() { cfg.mode = FTM_DEFAULT_MODE; @@ -77,8 +78,8 @@ class FxdTiCtrl { TERN_(HAS_X_AXIS, cfg.baseFreq[X_AXIS] = FTM_SHAPING_DEFAULT_X_FREQ); TERN_(HAS_Y_AXIS, cfg.baseFreq[Y_AXIS] = FTM_SHAPING_DEFAULT_Y_FREQ); - cfg.zeta = FTM_SHAPING_ZETA; - cfg.vtol = FTM_SHAPING_V_TOL; + cfg.zeta = FTM_SHAPING_ZETA; // Damping factor + cfg.vtol = FTM_SHAPING_V_TOL; // Vibration Level #if HAS_DYNAMIC_FREQ cfg.dynFreqMode = FTM_DEFAULT_DYNFREQ_MODE; @@ -114,7 +115,6 @@ class FxdTiCtrl { static void runoutBlock(); // Move any free data points to the stepper buffer even if a full batch isn't ready. static void loop(); // Controller main, to be invoked from non-isr task. - #if HAS_X_AXIS // Refresh the gains used by shaping functions. // To be called on init or mode or zeta change. @@ -168,6 +168,7 @@ class FxdTiCtrl { static hal_timer_t nextStepTicks; + // Shaping variables. #if HAS_X_AXIS typedef struct AxisShaping { @@ -202,10 +203,10 @@ class FxdTiCtrl { // Private methods static uint32_t stepperCmdBuffItems(); - static void loadBlockData(block_t * const current_block); + static void loadBlockData(block_t *const current_block); static void makeVector(); static void convertToSteps(const uint32_t idx); -}; // class fxdTiCtrl +}; // class FTMotion -extern FxdTiCtrl fxdTiCtrl; +extern FTMotion ftMotion; diff --git a/Marlin/src/module/ft_types.h b/Marlin/src/module/ft_types.h index a7228d32d6f2..6b708677d19c 100644 --- a/Marlin/src/module/ft_types.h +++ b/Marlin/src/module/ft_types.h @@ -56,15 +56,9 @@ typedef struct XYZEval xyze_stepDir_t; enum { LIST_N(DOUBLE(LOGICAL_AXES), FT_BIT_DIR_E, FT_BIT_STEP_E, - FT_BIT_DIR_X, FT_BIT_STEP_X, - FT_BIT_DIR_Y, FT_BIT_STEP_Y, - FT_BIT_DIR_Z, FT_BIT_STEP_Z, - FT_BIT_DIR_I, FT_BIT_STEP_I, - FT_BIT_DIR_J, FT_BIT_STEP_J, - FT_BIT_DIR_K, FT_BIT_STEP_K, - FT_BIT_DIR_U, FT_BIT_STEP_U, - FT_BIT_DIR_V, FT_BIT_STEP_V, - FT_BIT_DIR_W, FT_BIT_STEP_W + FT_BIT_DIR_X, FT_BIT_STEP_X, FT_BIT_DIR_Y, FT_BIT_STEP_Y, FT_BIT_DIR_Z, FT_BIT_STEP_Z, + FT_BIT_DIR_I, FT_BIT_STEP_I, FT_BIT_DIR_J, FT_BIT_STEP_J, FT_BIT_DIR_K, FT_BIT_STEP_K, + FT_BIT_DIR_U, FT_BIT_STEP_U, FT_BIT_DIR_V, FT_BIT_STEP_V, FT_BIT_DIR_W, FT_BIT_STEP_W ), FT_BIT_COUNT }; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index d091e67e0495..74ba41ccf699 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -2100,12 +2100,12 @@ void prepare_line_to_destination() { struct OnExit { ftMotionMode_t oldmm; OnExit() { - oldmm = fxdTiCtrl.cfg.mode; - fxdTiCtrl.cfg.mode = ftMotionMode_DISABLED; + oldmm = ftMotion.cfg.mode; + ftMotion.cfg.mode = ftMotionMode_DISABLED; } ~OnExit() { - fxdTiCtrl.cfg.mode = oldmm; - fxdTiCtrl.init(); + ftMotion.cfg.mode = oldmm; + ftMotion.init(); } } on_exit; #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6b645fa1337e..0916ade58158 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -229,10 +229,6 @@ float Planner::previous_nominal_speed; int32_t Planner::xy_freq_min_interval_us = LROUND(1000000.0f / (XY_FREQUENCY_LIMIT)); #endif -#if ENABLED(FT_MOTION) - bool Planner::fxdTiCtrl_busy = false; -#endif - #if ENABLED(LIN_ADVANCE) float Planner::extruder_advance_K[DISTINCT_E]; // Initialized by settings.load() #endif @@ -1692,7 +1688,7 @@ void Planner::quick_stop() { // Restart the block delay for the first movement - As the queue was // forced to empty, there's no risk the ISR will touch this. - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; TERN_(HAS_WIRED_LCD, clear_block_buffer_runtime()); // Clear the accumulated runtime @@ -1738,7 +1734,7 @@ bool Planner::busy() { return (has_blocks_queued() || cleaning_buffer_counter || TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING()) || TERN0(HAS_ZV_SHAPING, stepper.input_shaping_busy()) - || TERN0(FT_MOTION, fxdTiCtrl_busy) + || TERN0(FT_MOTION, ftMotion.busy) ); } @@ -1851,7 +1847,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target // As there are no queued movements, the Stepper ISR will not touch this // variable, so there is no risk setting this here (but it MUST be done // before the following line!!) - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; } // Move buffer head @@ -2005,7 +2001,7 @@ bool Planner::_populate_block( #if HAS_EXTRUDERS dm.e = (dist.e > 0); const float esteps_float = dist.e * e_factor[extruder]; - const uint32_t esteps = ABS(esteps_float) + 0.5f; + const uint32_t esteps = ABS(esteps_float); #else constexpr uint32_t esteps = 0; #endif @@ -2924,7 +2920,7 @@ void Planner::buffer_sync_block(const BlockFlagBit sync_flag/*=BLOCK_BIT_SYNC_PO // As there are no queued movements, the Stepper ISR will not touch this // variable, so there is no risk setting this here (but it MUST be done // before the following line!!) - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; } block_buffer_head = next_buffer_head; @@ -3217,7 +3213,7 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s // As there are no queued movements, the Stepper ISR will not touch this // variable, so there is no risk setting this here (but it MUST be done // before the following line!!) - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; } // Move buffer head diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 238657be7b36..6fde0b2bf38e 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -529,10 +529,6 @@ class Planner { } #endif - #if ENABLED(FT_MOTION) - static bool fxdTiCtrl_busy; - #endif - private: /** diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 989965d6d884..deeb53942ba3 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -735,7 +735,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { * * @param sanity_check Flag to compare the probe result with the expected result * based on the probe Z offset. If the result is too far away - * (more than 2mm too early) then consider it an error. + * (more than Z_PROBE_ERROR_TOLERANCE too early) then throw an error. * @param z_min_point Override the minimum probing height (-2mm), to allow deeper probing. * @param z_clearance Z clearance to apply on probe failure. * @@ -747,7 +747,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const_float_t z_min_p const float zoffs = SUM_TERN(HAS_HOTEND_OFFSET, -offset.z, hotend_offset[active_extruder].z); auto try_to_probe = [&](PGM_P const plbl, const_float_t z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck) -> bool { - constexpr float error_tolerance = 2.0f; + constexpr float error_tolerance = Z_PROBE_ERROR_TOLERANCE; if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(plbl); DEBUG_ECHOLNPGM("> try_to_probe(..., ", z_probe_low_point, ", ", fr_mm_s, ", ...)"); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index a4820ae900af..6f7c4b1ebca5 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -36,7 +36,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V88" +#define EEPROM_VERSION "V89" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -612,7 +612,7 @@ typedef struct SettingsDataStruct { // Fixed-Time Motion // #if ENABLED(FT_MOTION) - ft_config_t fxdTiCtrl_cfg; // M493 + ft_config_t ftMotion_cfg; // M493 #endif // @@ -634,6 +634,13 @@ typedef struct SettingsDataStruct { hotend_idle_settings_t hotend_idle_config; // M86 S T E B #endif + // + // Nonlinear Extrusion + // + #if ENABLED(NONLINEAR_EXTRUSION) + ne_coeff_t stepper_ne; // M592 A B C + #endif + } SettingsData; //static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); @@ -1704,8 +1711,8 @@ void MarlinSettings::postprocess() { // Fixed-Time Motion // #if ENABLED(FT_MOTION) - _FIELD_TEST(fxdTiCtrl_cfg); - EEPROM_WRITE(fxdTiCtrl.cfg); + _FIELD_TEST(ftMotion_cfg); + EEPROM_WRITE(ftMotion.cfg); #endif // @@ -1729,6 +1736,13 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(hotend_idle.cfg); #endif + // + // Nonlinear Extrusion + // + #if ENABLED(NONLINEAR_EXTRUSION) + EEPROM_WRITE(stepper.ne); + #endif + // // Report final CRC and Data Size // @@ -2771,8 +2785,8 @@ void MarlinSettings::postprocess() { // Fixed-Time Motion // #if ENABLED(FT_MOTION) - _FIELD_TEST(fxdTiCtrl_cfg); - EEPROM_READ(fxdTiCtrl.cfg); + _FIELD_TEST(ftMotion_cfg); + EEPROM_READ(ftMotion.cfg); #endif // @@ -2803,6 +2817,13 @@ void MarlinSettings::postprocess() { EEPROM_READ(hotend_idle.cfg); #endif + // + // Nonlinear Extrusion + // + #if ENABLED(NONLINEAR_EXTRUSION) + EEPROM_READ(stepper.ne); + #endif + // // Validate Final Size and CRC // @@ -3396,7 +3417,6 @@ void MarlinSettings::reset() { // // Heated Bed PID // - #if ENABLED(PIDTEMPBED) thermalManager.temp_bed.pid.set(DEFAULT_bedKp, DEFAULT_bedKi, DEFAULT_bedKd); #endif @@ -3404,7 +3424,6 @@ void MarlinSettings::reset() { // // Heated Chamber PID // - #if ENABLED(PIDTEMPCHAMBER) thermalManager.temp_chamber.pid.set(DEFAULT_chamberKp, DEFAULT_chamberKi, DEFAULT_chamberKd); #endif @@ -3456,7 +3475,6 @@ void MarlinSettings::reset() { // // Volumetric & Filament Size // - #if DISABLED(NO_VOLUMETRICS) parser.volumetric_enabled = ENABLED(VOLUMETRIC_DEFAULT_ON); for (uint8_t q = 0; q < COUNT(planner.filament_size); ++q) @@ -3596,7 +3614,12 @@ void MarlinSettings::reset() { // // Fixed-Time Motion // - TERN_(FT_MOTION, fxdTiCtrl.set_defaults()); + TERN_(FT_MOTION, ftMotion.set_defaults()); + + // + // Nonlinear Extrusion + // + TERN_(NONLINEAR_EXTRUSION, stepper.ne.reset()); // // Input Shaping @@ -3867,6 +3890,11 @@ void MarlinSettings::reset() { // TERN_(FT_MOTION, gcode.M493_report(forReplay)); + // + // Nonlinear Extrusion + // + TERN_(NONLINEAR_EXTRUSION, gcode.M592_report(forReplay)); + // // Input Shaping // diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 9bafe7443db1..a6c628e081cc 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -245,6 +245,13 @@ uint32_t Stepper::advance_divisor = 0, bool Stepper::la_active = false; #endif +#if ENABLED(NONLINEAR_EXTRUSION) + ne_coeff_t Stepper::ne; + ne_fix_t Stepper::ne_fix; + int32_t Stepper::ne_edividend; + uint32_t Stepper::ne_scale; +#endif + #if HAS_ZV_SHAPING shaping_time_t ShapingQueue::now = 0; #if ANY(MCU_LPC1768, MCU_LPC1769) && DISABLED(NO_LPC_ETHERNET_BUFFER) @@ -1485,11 +1492,14 @@ void Stepper::isr() { uint8_t max_loops = 10; #if ENABLED(FT_MOTION) - static bool fxdTiCtrl_stepCmdRdy = false; // Indicates a step command was loaded from the - // buffers and is ready to be output. - static bool fxdTiCtrl_applyDir = false; // Indicates the DIR output should be set. - static ft_command_t fxdTiCtrl_stepCmd = 0U; // Storage for the step command to be output. - static uint32_t fxdTiCtrl_nextAuxISR = 0U; // Storage for the next ISR of the auxilliary tasks. + static bool ftMotion_stepCmdRdy = false; // Indicates a step command was loaded from the + // buffers and is ready to be output. + static bool ftMotion_applyDir = false; // Indicates the DIR output should be set. + static ft_command_t ftMotion_stepCmd = 0U; // Storage for the step command to be output. + static uint32_t ftMotion_nextAuxISR = 0U; // Storage for the next ISR of the auxilliary tasks. + const bool using_ftMotion = ftMotion.cfg.mode; + #else + constexpr bool using_ftMotion = false; #endif // We need this variable here to be able to use it in the following loop @@ -1502,64 +1512,58 @@ void Stepper::isr() { #if ENABLED(FT_MOTION) - // NOTE STEPPER_TIMER_RATE is equal to 2000000, not what VSCode shows - const bool using_fxtictrl = fxdTiCtrl.cfg.mode; - if (using_fxtictrl) { + if (using_ftMotion) { if (!nextMainISR) { if (abort_current_block) { - fxdTiCtrl_stepCmdRdy = false; // If a command was ready, cancel it. - fxdTiCtrl.sts_stepperBusy = false; // Set busy false to allow a reset. + ftMotion_stepCmdRdy = false; // If a command was ready, cancel it. + ftMotion.sts_stepperBusy = false; // Set busy false to allow a reset. nextMainISR = 0.01f * (STEPPER_TIMER_RATE); // Come back in 10 msec. } else { // !(abort_current_block) - if (fxdTiCtrl_stepCmdRdy) { - fxdTiCtrl_stepper(fxdTiCtrl_applyDir, fxdTiCtrl_stepCmd); - fxdTiCtrl_stepCmdRdy = false; + if (ftMotion_stepCmdRdy) { + ftMotion_stepper(ftMotion_applyDir, ftMotion_stepCmd); + ftMotion_stepCmdRdy = false; } // Check if there is data in the buffers. - if (fxdTiCtrl.stepperCmdBuff_produceIdx != fxdTiCtrl.stepperCmdBuff_consumeIdx) { + if (ftMotion.stepperCmdBuff_produceIdx != ftMotion.stepperCmdBuff_consumeIdx) { - fxdTiCtrl.sts_stepperBusy = true; + ftMotion.sts_stepperBusy = true; // "Pop" one command from the command buffer. - fxdTiCtrl_stepCmd = fxdTiCtrl.stepperCmdBuff[fxdTiCtrl.stepperCmdBuff_consumeIdx]; - const uint8_t dir_index = fxdTiCtrl.stepperCmdBuff_consumeIdx >> 3, - dir_bit = fxdTiCtrl.stepperCmdBuff_consumeIdx & 0x7; - fxdTiCtrl_applyDir = TEST(fxdTiCtrl.stepperCmdBuff_ApplyDir[dir_index], dir_bit); - nextMainISR = fxdTiCtrl.stepperCmdBuff_StepRelativeTi[fxdTiCtrl.stepperCmdBuff_consumeIdx]; - fxdTiCtrl_stepCmdRdy = true; + ftMotion_stepCmd = ftMotion.stepperCmdBuff[ftMotion.stepperCmdBuff_consumeIdx]; + const uint8_t dir_index = ftMotion.stepperCmdBuff_consumeIdx >> 3, + dir_bit = ftMotion.stepperCmdBuff_consumeIdx & 0x7; + ftMotion_applyDir = TEST(ftMotion.stepperCmdBuff_ApplyDir[dir_index], dir_bit); + nextMainISR = ftMotion.stepperCmdBuff_StepRelativeTi[ftMotion.stepperCmdBuff_consumeIdx]; + ftMotion_stepCmdRdy = true; - if (++fxdTiCtrl.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) - fxdTiCtrl.stepperCmdBuff_consumeIdx = 0; + if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) + ftMotion.stepperCmdBuff_consumeIdx = 0; } else { // Buffer empty. - fxdTiCtrl.sts_stepperBusy = false; + ftMotion.sts_stepperBusy = false; nextMainISR = 0.01f * (STEPPER_TIMER_RATE); // Come back in 10 msec. } } // !(abort_current_block) } // if (!nextMainISR) - // Define 2.5 msec task for auxilliary functions. - if (!fxdTiCtrl_nextAuxISR) { + // Define 2.5 msec task for auxiliary functions. + if (!ftMotion_nextAuxISR) { endstops.update(); TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr()); - fxdTiCtrl_refreshAxisDidMove(); - fxdTiCtrl_nextAuxISR = 0.0025f * (STEPPER_TIMER_RATE); + ftMotion_refreshAxisDidMove(); + ftMotion_nextAuxISR = 0.0025f * (STEPPER_TIMER_RATE); } - interval = _MIN(nextMainISR, fxdTiCtrl_nextAuxISR); + interval = _MIN(nextMainISR, ftMotion_nextAuxISR); nextMainISR -= interval; - fxdTiCtrl_nextAuxISR -= interval; + ftMotion_nextAuxISR -= interval; } - #else - - constexpr bool using_fxtictrl = false; - #endif - if (!using_fxtictrl) { + if (!using_ftMotion) { TERN_(HAS_ZV_SHAPING, shaping_isr()); // Do Shaper stepping, if needed @@ -2191,6 +2195,16 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) { #endif // !CPU_32_BIT } +#if ENABLED(NONLINEAR_EXTRUSION) + void Stepper::calc_nonlinear_e(uint32_t step_rate) { + const uint32_t velocity = ne_scale * step_rate; // Scale step_rate first so all intermediate values stay in range of 8.24 fixed point math + int32_t vd = (((int64_t)ne_fix.A * velocity) >> 24) + (((((int64_t)ne_fix.B * velocity) >> 24) * velocity) >> 24); + NOLESS(vd, 0); + + advance_dividend.e = (uint64_t(ne_fix.C + vd) * ne_edividend) >> 24; + } +#endif + // Get the timer interval and the number of loops to perform per tick hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) { @@ -2318,6 +2332,10 @@ hal_timer_t Stepper::block_phase_isr() { interval = calc_multistep_timer_interval(acc_step_rate << oversampling_factor); acceleration_time += interval; + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(acc_step_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) { const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0; @@ -2388,6 +2406,10 @@ hal_timer_t Stepper::block_phase_isr() { interval = calc_multistep_timer_interval(step_rate << oversampling_factor); deceleration_time += interval; + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(step_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) { const uint32_t la_step_rate = la_advance_steps > current_block->final_adv_steps ? current_block->la_advance_rate : 0; @@ -2436,6 +2458,10 @@ hal_timer_t Stepper::block_phase_isr() { // step_rate to timer interval and loops for the nominal speed ticks_nominal = calc_multistep_timer_interval(current_block->nominal_rate << oversampling_factor); + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(current_block->nominal_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) la_interval = calc_timer_interval(current_block->nominal_rate >> current_block->la_scaling); @@ -2636,10 +2662,13 @@ hal_timer_t Stepper::block_phase_isr() { acceleration_time = deceleration_time = 0; #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - oversampling_factor = 0; // Assume no axis smoothing (via oversampling) + // Nonlinear Extrusion needs at least 2x oversampling to permit increase of E step rate + // Otherwise assume no axis smoothing (via oversampling) + oversampling_factor = TERN(NONLINEAR_EXTRUSION, 1, 0); + // Decide if axis smoothing is possible - uint32_t max_rate = current_block->nominal_rate; // Get the step event rate if (TERN1(DWIN_LCD_PROUI, hmiData.adaptiveStepSmoothing)) { + uint32_t max_rate = current_block->nominal_rate; // Get the step event rate while (max_rate < MIN_STEP_ISR_FREQUENCY) { // As long as more ISRs are possible... max_rate <<= 1; // Try to double the rate if (max_rate < MIN_STEP_ISR_FREQUENCY) // Don't exceed the estimated ISR limit @@ -2755,10 +2784,29 @@ hal_timer_t Stepper::block_phase_isr() { acc_step_rate = current_block->initial_rate; #endif + #if ENABLED(NONLINEAR_EXTRUSION) + ne_edividend = advance_dividend.e; + const float scale = (float(ne_edividend) / advance_divisor) * planner.mm_per_step[E_AXIS_N(current_block->extruder)]; + ne_scale = (1L << 24) * scale; + if (current_block->direction_bits.e) { + ne_fix.A = (1L << 24) * ne.A; + ne_fix.B = (1L << 24) * ne.B; + ne_fix.C = (1L << 24) * ne.C; + } + else { + ne_fix.A = ne_fix.B = 0; + ne_fix.C = (1L << 24); + } + #endif + // Calculate the initial timer interval interval = calc_multistep_timer_interval(current_block->initial_rate << oversampling_factor); acceleration_time += interval; + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(current_block->initial_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) { const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0; @@ -3385,12 +3433,8 @@ void Stepper::report_a_position(const xyz_long_t &pos) { TERN(SAYS_A, PSTR(STR_COUNT_A), PSTR(STR_COUNT_X)), pos.x, TERN(SAYS_B, PSTR("B:"), SP_Y_LBL), pos.y, TERN(SAYS_C, PSTR("C:"), SP_Z_LBL), pos.z, - SP_I_LBL, pos.i, - SP_J_LBL, pos.j, - SP_K_LBL, pos.k, - SP_U_LBL, pos.u, - SP_V_LBL, pos.v, - SP_W_LBL, pos.w + SP_I_LBL, pos.i, SP_J_LBL, pos.j, SP_K_LBL, pos.k, + SP_U_LBL, pos.u, SP_V_LBL, pos.v, SP_W_LBL, pos.w ) ); #endif @@ -3415,7 +3459,7 @@ void Stepper::report_positions() { #if ENABLED(FT_MOTION) // Set stepper I/O for fixed time controller. - void Stepper::fxdTiCtrl_stepper(const bool applyDir, const ft_command_t command) { + void Stepper::ftMotion_stepper(const bool applyDir, const ft_command_t command) { USING_TIMED_PULSE(); @@ -3507,13 +3551,13 @@ void Stepper::report_positions() { if (axis_step.w) W_APPLY_STEP(!STEP_STATE_W, false) ); - } // Stepper::fxdTiCtrl_stepper + } // Stepper::ftMotion_stepper - void Stepper::fxdTiCtrl_BlockQueueUpdate() { + void Stepper::ftMotion_BlockQueueUpdate() { if (current_block) { // If the current block is not done processing, return right away - if (!fxdTiCtrl.getBlockProcDn()) return; + if (!ftMotion.getBlockProcDn()) return; axis_did_move.reset(); current_block = nullptr; @@ -3540,21 +3584,21 @@ void Stepper::report_positions() { // update it here, even though it will may be out of sync with step commands last_direction_bits = current_block->direction_bits; - fxdTiCtrl.startBlockProc(current_block); + ftMotion.startBlockProc(current_block); } else { - fxdTiCtrl.runoutBlock(); + ftMotion.runoutBlock(); return; // No queued blocks } } // if (!current_block) - } // Stepper::fxdTiCtrl_BlockQueueUpdate() + } // Stepper::ftMotion_BlockQueueUpdate() // Debounces the axis move indication to account for potential // delay between the block information and the stepper commands - void Stepper::fxdTiCtrl_refreshAxisDidMove() { + void Stepper::ftMotion_refreshAxisDidMove() { // Set the debounce time in seconds. #define AXIS_DID_MOVE_DEB 5 // TODO: The debounce time should be calculated if possible, diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 7dbb6b8b5a1d..eb84426dc79d 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -284,12 +284,17 @@ constexpr ena_mask_t enable_overlap[] = { #endif // HAS_ZV_SHAPING +#if ENABLED(NONLINEAR_EXTRUSION) + typedef struct { float A, B, C; void reset() { A = B = 0.0f; C = 1.0f; } } ne_coeff_t; + typedef struct { int32_t A, B, C; } ne_fix_t; +#endif + // // Stepper class definition // class Stepper { friend class Max7219; - friend class FxdTiCtrl; + friend class FTMotion; friend void stepperTask(void *); public: @@ -326,6 +331,10 @@ class Stepper { static bool frozen; // Set this flag to instantly freeze motion #endif + #if ENABLED(NONLINEAR_EXTRUSION) + static ne_coeff_t ne; + #endif + private: static block_t* current_block; // A pointer to the block currently being traced @@ -416,6 +425,12 @@ class Stepper { static bool la_active; // Whether linear advance is used on the present segment. #endif + #if ENABLED(NONLINEAR_EXTRUSION) + static int32_t ne_edividend; + static uint32_t ne_scale; + static ne_fix_t ne_fix; + #endif + #if ENABLED(BABYSTEPPING) static constexpr hal_timer_t BABYSTEP_NEVER = HAL_TIMER_TYPE_MAX; static hal_timer_t nextBabystepISR; @@ -520,7 +535,7 @@ class Stepper { if (current_block->is_page()) page_manager.free_page(current_block->page_idx); #endif current_block = nullptr; - axis_did_move = 0; + axis_did_move.reset(); planner.release_current_block(); TERN_(LIN_ADVANCE, la_interval = nextAdvanceISR = LA_ADV_NEVER); } @@ -639,7 +654,7 @@ class Stepper { #if ENABLED(FT_MOTION) // Manage the planner - static void fxdTiCtrl_BlockQueueUpdate(); + static void ftMotion_BlockQueueUpdate(); #endif #if HAS_ZV_SHAPING @@ -660,6 +675,10 @@ class Stepper { // Calculate timing interval and steps-per-ISR for the given step rate static hal_timer_t calc_multistep_timer_interval(uint32_t step_rate); + #if ENABLED(NONLINEAR_EXTRUSION) + static void calc_nonlinear_e(uint32_t step_rate); + #endif + #if ENABLED(S_CURVE_ACCELERATION) static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av); static int32_t _eval_bezier_curve(const uint32_t curr_step); @@ -674,8 +693,8 @@ class Stepper { #endif #if ENABLED(FT_MOTION) - static void fxdTiCtrl_stepper(const bool applyDir, const ft_command_t command); - static void fxdTiCtrl_refreshAxisDidMove(); + static void ftMotion_stepper(const bool applyDir, const ft_command_t command); + static void ftMotion_refreshAxisDidMove(); #endif }; diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 622877667d43..b33b642966ae 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -940,19 +940,20 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. * sync_plan_position_e(); */ void extruder_cutting_recover(const_float_t e) { - if (!too_cold(active_extruder)) { - const float dist = toolchange_settings.extra_resume + toolchange_settings.wipe_retract; - FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); - unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed)); - planner.synchronize(); - FS_DEBUG("Set position to: ", e); - current_position.e = e; - sync_plan_position_e(); // Resume new E Position - } + if (too_cold(active_extruder)) return; + + const float dist = toolchange_settings.extra_resume + toolchange_settings.wipe_retract; + FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); + unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed)); + + FS_DEBUG("Set E position: ", e); + current_position.e = e; + sync_plan_position_e(); // Resume new E Position } /** * Prime the currently selected extruder (Filament loading only) + * Leave the E position unchanged so subsequent extrusion works properly. * * If too_cold(toolID) returns TRUE -> returns without moving extruder. * Extruders filament = swap_length + extra prime, then performs cutting retraction if enabled. @@ -966,6 +967,8 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. feedRate_t fr_mm_s = MMM_TO_MMS(toolchange_settings.unretract_speed); // Set default speed for unretract + const float resume_current_e = current_position.e; + #if ENABLED(TOOLCHANGE_FS_SLOW_FIRST_PRIME) /** * Perform first unretract movement at the slower Prime_Speed to avoid breakage on first prime @@ -1010,6 +1013,10 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. unscaled_e_move(-toolchange_settings.wipe_retract, MMM_TO_MMS(toolchange_settings.retract_speed)); #endif + // Leave E unchanged when priming + current_position.e = resume_current_e; + sync_plan_position_e(); + // Cool down with fan filament_swap_cooling(); } @@ -1061,17 +1068,19 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. } #endif + // Prime without changing E extruder_prime(); // Move back #if ENABLED(TOOLCHANGE_PARK) if (ok) { #if ENABLED(TOOLCHANGE_NO_RETURN) - const float temp = destination.z; - destination = current_position; - destination.z = temp; + destination.x = current_position.x; + destination.y = current_position.y; #endif - prepare_internal_move_to_destination(TERN(TOOLCHANGE_NO_RETURN, planner.settings.max_feedrate_mm_s[Z_AXIS], MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE))); + do_blocking_move_to_xy(destination, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); + planner.synchronize(); } #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5737f3eea0f8..d3f30e0e3f7a 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -774,6 +774,8 @@ #include "stm32f4/pins_ANET_ET4P.h" // STM32F4 env:Anet_ET4_no_bootloader env:Anet_ET4_OpenBLT #elif MB(FYSETC_CHEETAH_V20) #include "stm32f4/pins_FYSETC_CHEETAH_V20.h" // STM32F4 env:FYSETC_CHEETAH_V20 +#elif MB(FYSETC_CHEETAH_V30) + #include "stm32f4/pins_FYSETC_CHEETAH_V30.h" // STM32F4 env:FYSETC_CHEETAH_V30 #elif MB(MKS_MONSTER8_V1) #include "stm32f4/pins_MKS_MONSTER8_V1.h" // STM32F4 env:mks_monster8 env:mks_monster8_usb_flash_drive env:mks_monster8_usb_flash_drive_msc #elif MB(MKS_MONSTER8_V2) diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h new file mode 100644 index 000000000000..70a9bf9de20d --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h @@ -0,0 +1,319 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "env_validate.h" + +#define BOARD_INFO_NAME "FYSETC Cheetah V3.0" +#define BOARD_WEBSITE_URL "fysetc.com" + +// USB Flash Drive support +//#define HAS_OTG_USB_HOST_SUPPORT + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#if ANY(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define FLASH_EEPROM_LEVELING + +#endif + +// +// Z Probe +// +//#if ENABLED(BLTOUCH) +// #error "You need to set jumper to 5V for BLTouch, then comment out this line to proceed." +// #define SERVO0_PIN PA0 +//#elif !defined(Z_MIN_PROBE_PIN) +// #define Z_MIN_PROBE_PIN PA0 +//#endif + +// +// Limit Switches +// +#define X_STOP_PIN PA2 +#define Y_STOP_PIN PA3 +#define Z_STOP_PIN PC4 + +#if 1 +#define TEST_IO1 PA0 // PROBE +#define TEST_IO2 PA1 // FIL-D +//#define TEST_IO3 PA9 +//#define TEST_IO4 PA10 +#endif + +// +// Filament runout +// +//#define FIL_RUNOUT_PIN PA1 + +// +// Steppers +// +#define X_STEP_PIN PC0 +#define X_DIR_PIN PC1 +#define X_ENABLE_PIN PC3 + +#define Y_STEP_PIN PC14 +#define Y_DIR_PIN PC13 +#define Y_ENABLE_PIN PC15 + +#define Z_STEP_PIN PB4 +#define Z_DIR_PIN PB5 +#define Z_ENABLE_PIN PC2 + +#define E0_STEP_PIN PB2 +#define E0_DIR_PIN PA15 +#define E0_ENABLE_PIN PD2 + +#if HAS_TMC_UART + #if 1 + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN PB3 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + #endif + + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN PB3 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + #endif + + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN PB3 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #endif + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN PB3 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + #endif + + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #else + #define X_HARDWARE_SERIAL Serial2 + #define Y_HARDWARE_SERIAL Serial2 + #define Z_HARDWARE_SERIAL Serial2 + #define E0_HARDWARE_SERIAL Serial2 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #endif +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC7 // PWM +#define HEATER_BED_PIN PC8 // PWM + +#ifndef FAN0_PIN + #define FAN0_PIN PA14 +#endif +#define FAN1_PIN PA13 +#define FAN2_PIN PA8 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC5 // Analog Input T0 ADC +#define TEMP_BED_PIN PB1 // Analog Input ADC +#define TEMP_CHAMBER_PIN PB0 // Analog Input T1 ADC + +// +// Misc. Functions +// +#if 0 + #define SDSS PA4 + #define SD_DETECT_PIN PC3 +#endif + +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB0 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB7 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB6 +#endif + +/** + * ----- ----- + * (KILL?) 5V | 1 2 | GND 5V | 1 2 | GND + * (RST) RESET | 3 4 | PC12 ((SD_DET?)CD) (LCD_D7 BLUE) PB7 | 3 4 | PB6 (LCD_D6 GREEN) + * ((SD?)MOSI PA7 | 5 6 | PC11 (BTN_EN2) (LCD_D5 RED DIN) PB14 | 5 6 | PB13 (LCD_D4 LCD_RST) + * ((SD?)SS) PA4 | 7 8 | PC10 (BTN_EN1) (LCD_RS LCD_A0) PB12 | 7 8 | PB15 (LCD_EN LCD CS) + * ((SD?)SCK) PA5 | 9 10| PA6 ((SD?)MISO) (BTN_ENC) PC6 | 9 10| PB10 (BEEPER) + * ----- ----- + * EXP2 EXP1 + */ + +/** + * ----- + * (BEEPER) PC9 | 1 2 | PC12 (BTN_ENC) + * (BTN_EN1) PC10 | 3 4 | PB14 (LCD_D5/MISO) + * (BTN_EN2) PC11 5 6 | PB13 (LCD_D4/SCK) + * (LCD_RS) PB12 | 7 8 | PB15 (LCD_EN/MOSI) + * GND | 9 10| 5V + * ----- + * EXP3 + */ + +#define EXP1_03_PIN PB7 +#define EXP1_04_PIN PB6 +#define EXP1_05_PIN PB14 +#define EXP1_06_PIN PB13 +#define EXP1_07_PIN PB12 +#define EXP1_08_PIN PB15 +#define EXP1_09_PIN PC6 +#define EXP1_10_PIN PB10 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN PC12 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PC11 +#define EXP2_07_PIN PA4 +#define EXP2_08_PIN PC10 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + +// +// SPI / SD Card +// +#define SD_SCK_PIN EXP2_09_PIN +#define SD_MISO_PIN EXP2_10_PIN +#define SD_MOSI_PIN EXP2_05_PIN + +#define SDSS EXP2_07_PIN +#define SD_DETECT_PIN EXP2_04_PIN + +#if HAS_WIRED_LCD + + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #else + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN EXP1_05_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXP1_04_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXP1_03_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXP1_05_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 96 + #define BOARD_ST7920_DELAY_2 48 + #define BOARD_ST7920_DELAY_3 600 +#endif + +#if ENABLED(TOUCH_UI_FTDI_EVE) + #define BEEPER_PIN EXP1_10_PIN + #define CLCD_MOD_RESET EXP2_08_PIN + #define CLCD_SPI_CS EXP2_06_PIN +#endif + +#define NEOPIXEL2_PIN PC9 diff --git a/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json new file mode 100644 index 000000000000..8c46404f3812 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json @@ -0,0 +1,35 @@ +{ + "build": { + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F446xx", + "f_cpu": "180000000L", + "mcu": "stm32f446ret6", + "variant": "MARLIN_F446VE" + }, + "connectivity": [ + "can" + ], + "debug": { + "jlink_device": "STM32F446RE", + "openocd_target": "stm32f4x", + "svd_path": "STM32F446x.svd" + }, + "frameworks": [ + "arduino", + "stm32cube" + ], + "name": "3D Printer control board", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 524288, + "protocol": "stlink", + "protocols": [ + "jlink", + "stlink", + "blackmagic", + "serial" + ] + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html", + "vendor": "FYSETC" +} diff --git a/buildroot/tests/STM32F103RC_btt b/buildroot/tests/STM32F103RC_btt index 8df20740c49c..b9fff2b6c533 100755 --- a/buildroot/tests/STM32F103RC_btt +++ b/buildroot/tests/STM32F103RC_btt @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \ X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209 -opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT FT_MOTION FT_MOTION_MENU +opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT FT_MOTION FT_MOTION_MENU ADAPTIVE_STEP_SMOOTHING NONLINEAR_EXTRUSION exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - TMC2209 HW Serial, FT_MOTION" "$3" # clean up diff --git a/docs/Queue.md b/docs/Queue.md index bce68b0551a7..6d4fb9d041db 100644 --- a/docs/Queue.md +++ b/docs/Queue.md @@ -19,7 +19,7 @@ Here's a basic flowchart of Marlin command processing: | Host | | SerialState RingBuffer | | | | | Marlin | NUM_SERIAL BUF_SIZE | | Marlin | +--+---+ R/TX_BUFFER_SIZE | +---+ +------------------+ | | | - | +------------+ | | | | | | | GCode | + | +------------+ | | | | | | | G-Code | | | | | | | | MAX_CMD_SIZE +-+-----> processor | | | Platform | | | | On EOL | +--------------+ | r_pos | | +-------------> serial's +-----------> +--------> | G-code | | | +-----------+ diff --git a/ini/features.ini b/ini/features.ini index 1a3546e575fd..c89f2fea417f 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -312,6 +312,7 @@ CONTROLLER_FAN_EDITABLE = build_src_filter=+ GCODE_MACROS = build_src_filter=+ GRADIENT_MIX = build_src_filter=+ +NONLINEAR_EXTRUSION = build_src_filter=+ OTA_FIRMWARE_UPDATE = build_src_filter=+ HAS_SAVED_POSITIONS = build_src_filter=+ + PARK_HEAD_ON_PAUSE = build_src_filter=+ diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 454337295d29..20009c89439f 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -38,6 +38,17 @@ board_build.offset = 0x8000 build_flags = ${stm32_variant.build_flags} -DSTM32F401xC upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" +# +# STM32F446RC nobootloader +# +[env:FYSETC_CHEETAH_V30] +extends = stm32_variant +board = marlin_FYSETC_CHEETAH_V30 +build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED +debug_tool = stlink +upload_protocol = dfu +upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" + # # FLYF407ZG #