diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 59de828a6ff0..61834e2dc748 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -896,8 +896,9 @@ // Enable for Polargraph Kinematics //#define POLARGRAPH #if ENABLED(POLARGRAPH) - #define POLARGRAPH_MAX_BELT_LEN 1035.0 - #define DEFAULT_SEGMENTS_PER_SECOND 5 + #define POLARGRAPH_MAX_BELT_LEN 1035.0 // (mm) Belt length at full extension. Override with M665 H. + #define DEFAULT_SEGMENTS_PER_SECOND 5 // Move segmentation based on duration + #define PEN_UP_DOWN_MENU // Add "Pen Up" and "Pen Down" to the MarlinUI menu #endif // @section delta diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index cda364a58742..64028d0553f7 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -304,8 +304,8 @@ #define THERMAL_PROTECTION_HYSTERESIS 5 // Degrees Celsius //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops - #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) - //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP) + //#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T #endif /** @@ -843,20 +843,20 @@ //#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops #if ENABLED(Z_MULTI_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG. - #define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Y endstop + #define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Z endstop #endif #ifdef Z3_DRIVER_TYPE //#define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z #if ENABLED(Z_MULTI_ENDSTOPS) #define Z3_USE_ENDSTOP _YMAX_ // Z3 endstop board plug. Don't forget to enable USE_*_PLUG. - #define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Y endstop + #define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Z endstop #endif #endif #ifdef Z4_DRIVER_TYPE //#define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z #if ENABLED(Z_MULTI_ENDSTOPS) #define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG. - #define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Y endstop + #define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Z endstop #endif #endif #endif diff --git a/Marlin/Version.h b/Marlin/Version.h index 77f889518c3e..be1a6956bfaf 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-27" +//#define STRING_DISTRIBUTION_DATE "2023-02-04" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/AVR/fastio.h b/Marlin/src/HAL/AVR/fastio.h index 612ab902e36f..8a5e4650f4c6 100644 --- a/Marlin/src/HAL/AVR/fastio.h +++ b/Marlin/src/HAL/AVR/fastio.h @@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t { #if HAS_MOTOR_CURRENT_PWM #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY) + #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN || P == MOTOR_CURRENT_PWM_XY_PIN) #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z) + #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN) #else - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1) + #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN) #endif #else #define PWM_CHK_MOTOR_CURRENT(P) false diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp index 473b656f9a3c..1b5c0ae5b2c0 100644 --- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp @@ -48,7 +48,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; bool PersistentStore::access_start() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) return true; @@ -63,7 +63,7 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); int bytes_written = 0; if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE); diff --git a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp index d608ccee1441..9cfa97c1ab6e 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp @@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; bool PersistentStore::access_start() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) return true; // false aborts the save @@ -62,7 +62,7 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); int bytes_written = 0; if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE); diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index c19bc087833d..a1126d74615c 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -337,8 +337,8 @@ void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space void print_bin(const uint16_t val); void print_pos(NUM_AXIS_ARGS(const_float_t), FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr); -inline void print_pos(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) { - print_pos(NUM_AXIS_ELEM(xyz), prefix, suffix); +inline void print_pos(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) { + print_pos(NUM_AXIS_ELEM(xyze), prefix, suffix); } #define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 61c182448e45..f1fae85b5ca4 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -430,21 +430,24 @@ struct XYval { FI XYval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } FI XYval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } + FI XYval& operator+=(const XYZval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYval& operator-=(const XYZval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYval& operator*=(const XYZval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYval& operator/=(const XYZval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } + FI XYval& operator+=(const XYZEval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYval& operator-=(const XYZEval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYval& operator*=(const XYZEval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYval& operator/=(const XYZEval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } FI XYval& operator*=(const float &p) { x *= p; y *= p; return *this; } FI XYval& operator*=(const int &p) { x *= p; y *= p; return *this; } FI XYval& operator>>=(const int &p) { _RS(x); _RS(y); return *this; } FI XYval& operator<<=(const int &p) { _LS(x); _LS(y); return *this; } // Exact comparisons. For floats a "NEAR" operation may be better. - FI bool operator==(const XYval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZEval &rs) const { return x == rs.x && y == rs.y; } + FI bool operator==(const XYval &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); } + FI bool operator==(const XYZval &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); } + FI bool operator==(const XYZEval &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); } FI bool operator!=(const XYval &rs) const { return !operator==(rs); } FI bool operator!=(const XYZval &rs) const { return !operator==(rs); } FI bool operator!=(const XYZEval &rs) const { return !operator==(rs); } @@ -465,15 +468,9 @@ struct XYZval { FI void reset() { NUM_AXIS_GANG(x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; } // Setters taking struct types and arrays - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } - FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } - FI void set(const XYval pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP); } - FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; } - #if HAS_Z_AXIS - FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } - FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); } - #endif + FI void set(const XYval pxy) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y,,,,,,,); } + FI void set(const XYval pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz,,,,,,); } + FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } #if LOGICAL_AXES > NUM_AXES FI void set(const T (&arr)[LOGICAL_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } FI void set(LOGICAL_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); } @@ -481,6 +478,17 @@ struct XYZval { FI void set(const T (&arr)[DISTINCT_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } #endif #endif + + // Setter for all individual args + FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } + + // Setters with fewer elements leave the rest untouched + #if HAS_Y_AXIS + FI void set(const T px) { x = px; } + #endif + #if HAS_Z_AXIS + FI void set(const T px, const T py) { x = px; y = py; } + #endif #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif @@ -545,14 +553,14 @@ struct XYZval { FI XYZval& operator= (const XYZEval &rs) { set(NUM_AXIS_ELEM(rs)); return *this; } // Override other operators to get intuitive behaviors - FI XYZval operator+ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator+ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator- (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator- (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator* (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator* (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator/ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator/ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } + FI XYZval operator+ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; } + FI XYZval operator+ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; } + FI XYZval operator- (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; } + FI XYZval operator- (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; } + FI XYZval operator* (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; } + FI XYZval operator* (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; } + FI XYZval operator/ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; } + FI XYZval operator/ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; } FI XYZval operator+ (const XYZval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZval operator+ (const XYZval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZval operator- (const XYZval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; } @@ -585,10 +593,10 @@ struct XYZval { FI XYZval operator-() { XYZval o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; } // Modifier operators - FI XYZval& operator+=(const XYval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } - FI XYZval& operator-=(const XYval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } - FI XYZval& operator*=(const XYval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } - FI XYZval& operator/=(const XYval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } + FI XYZval& operator+=(const XYval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYZval& operator-=(const XYval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYZval& operator*=(const XYval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYZval& operator/=(const XYval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } FI XYZval& operator+=(const XYZval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; } FI XYZval& operator-=(const XYZval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZval& operator*=(const XYZval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } @@ -620,9 +628,31 @@ struct XYZEval { // Reset all to 0 FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; } - // Setters for some number of linear axes, not all - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } + // Setters taking struct types and arrays + FI void set(const XYval pxy) { x = pxy.x; OPTCODE(HAS_Y_AXIS, y = pxy.y) } + FI void set(const XYZval pxyz) { set(NUM_AXIS_ELEM(pxyz)); } + FI void set(const XYval pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); } + FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } + #if LOGICAL_AXES > NUM_AXES + FI void set(const T (&arr)[LOGICAL_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } + FI void set(const XYval pxy, const T pz, const T pe) { set(pxy, pz); e = pe; } + FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } + FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } + #if DISTINCT_AXES > LOGICAL_AXES + FI void set(const T (&arr)[DISTINCT_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } + #endif + #endif + + // Setter for all individual args + FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } + + // Setters with fewer elements leave the rest untouched + #if HAS_Y_AXIS + FI void set(const T px) { x = px; } + #endif + #if HAS_Z_AXIS + FI void set(const T px, const T py) { x = px; y = py; } + #endif #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif @@ -642,19 +672,6 @@ struct XYZEval { FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu, const T pv) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; } #endif - // Setters taking struct types and arrays - FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } - FI void set(const XYZval pxyz) { set(NUM_AXIS_ELEM(pxyz)); } - #if HAS_Z_AXIS - FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } - #endif - FI void set(const XYval pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); } - #if LOGICAL_AXES > NUM_AXES - FI void set(const XYval pxy, const T pz, const T pe) { set(pxy, pz); e = pe; } - FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } - FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } - #endif - // Length reduced to one dimension FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } // Pointer to the data as a simple array @@ -739,10 +756,10 @@ struct XYZEval { FI XYZEval operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); } // Modifier operators - FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYZEval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } + FI XYZEval& operator+=(const XYval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYZEval& operator-=(const XYval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYZEval& operator*=(const XYval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYZEval& operator/=(const XYval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } FI XYZEval& operator+=(const XYZval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; } FI XYZEval& operator-=(const XYZval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZEval& operator*=(const XYZval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index d4450adcd853..2825f4d4f219 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -33,7 +33,7 @@ bool PrintJobRecovery::enabled; // Initialized by settings.load() -SdFile PrintJobRecovery::file; +MediaFile PrintJobRecovery::file; job_recovery_info_t PrintJobRecovery::info; const char PrintJobRecovery::filename[5] = "/PLR"; uint8_t PrintJobRecovery::queue_index_r; diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 4bf0c06e2d7e..d241fdb74c8e 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -138,7 +138,7 @@ class PrintJobRecovery { public: static const char filename[5]; - static SdFile file; + static MediaFile file; static job_recovery_info_t info; static uint8_t queue_index_r; //!< Queue index of the active command diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index a6dff2d75a41..0b6548a3e3fa 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -403,6 +403,9 @@ void GcodeSuite::G28() { UNUSED(needZ); UNUSED(homeZZ); #else constexpr bool doZ = false; + #if !HAS_Y_AXIS + constexpr bool doY = false; + #endif #endif TERN_(HOME_Z_FIRST, if (doZ) homeaxis(Z_AXIS)); @@ -420,9 +423,11 @@ void GcodeSuite::G28() { // Diagonal move first if both are homing TERN_(QUICK_HOME, if (doX && doY) quick_home_xy()); - // Home Y (before X) - if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX))) - homeaxis(Y_AXIS); + #if HAS_Y_AXIS + // Home Y (before X) + if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX))) + homeaxis(Y_AXIS); + #endif // Home X if (doX || (doY && ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X))) { @@ -455,9 +460,11 @@ void GcodeSuite::G28() { if (doI) homeaxis(I_AXIS); #endif - // Home Y (after X) - if (DISABLED(HOME_Y_BEFORE_X) && doY) - homeaxis(Y_AXIS); + #if HAS_Y_AXIS + // Home Y (after X) + if (DISABLED(HOME_Y_BEFORE_X) && doY) + homeaxis(Y_AXIS); + #endif #if BOTH(FOAMCUTTER_XYUV, HAS_J_AXIS) // Home J (after Y) diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index b85487af45c2..889709c04531 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -35,11 +35,24 @@ /** * G61: Return to saved position * - * F - Feedrate (optional) for the move back. - * S - Slot # (0-based) to restore from (default 0). - * X Y Z E - Axes to restore. At least one is required. + * F - Feedrate (optional) for the move back. + * S - Slot # (0-based) to restore from (default 0). + * X - Restore X axis, applying the given offset (default 0) + * Y - Restore Y axis, applying the given offset (default 0) + * Z - Restore Z axis, applying the given offset (default 0) * - * If XYZE are not given, default restore uses the smart blocking move. + * If there is an Extruder: + * E - Restore E axis, applying the given offset (default 0) + * + * With extra axes using default names: + * A - Restore 4th axis, applying the given offset (default 0) + * B - Restore 5th axis, applying the given offset (default 0) + * C - Restore 6th axis, applying the given offset (default 0) + * U - Restore 7th axis, applying the given offset (default 0) + * V - Restore 8th axis, applying the given offset (default 0) + * W - Restore 9th axis, applying the given offset (default 0) + * + * If no axes are specified then all axes are restored. */ void GcodeSuite::G61() { @@ -71,7 +84,7 @@ void GcodeSuite::G61() { if (parser.seen(STR_AXES_MAIN)) { DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot); LOOP_NUM_AXES(i) { - destination[i] = parser.seenval(AXIS_CHAR(i)) + destination[i] = parser.seen(AXIS_CHAR(i)) ? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i) : current_position[i]; DEBUG_CHAR(' ', AXIS_CHAR(i)); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c4926edd51c7..920ad15c6cc6 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -603,12 +603,26 @@ #else #undef EXTRUDERS #define EXTRUDERS 0 + #undef TEMP_SENSOR_0 + #undef TEMP_SENSOR_1 + #undef TEMP_SENSOR_2 + #undef TEMP_SENSOR_3 + #undef TEMP_SENSOR_4 + #undef TEMP_SENSOR_5 + #undef TEMP_SENSOR_6 + #undef TEMP_SENSOR_7 #undef SINGLENOZZLE #undef SWITCHING_EXTRUDER #undef SWITCHING_NOZZLE #undef MIXING_EXTRUDER #undef HOTEND_IDLE_TIMEOUT #undef DISABLE_E + #undef THERMAL_PROTECTION_HOTENDS + #undef PREVENT_COLD_EXTRUSION + #undef PREVENT_LENGTHY_EXTRUDE + #undef FILAMENT_RUNOUT_SENSOR + #undef FILAMENT_RUNOUT_DISTANCE_MM + #undef DISABLE_INACTIVE_EXTRUDER #endif #define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) @@ -682,20 +696,28 @@ #if E_STEPPERS <= 7 #undef INVERT_E7_DIR + #undef E7_DRIVER_TYPE #if E_STEPPERS <= 6 #undef INVERT_E6_DIR + #undef E6_DRIVER_TYPE #if E_STEPPERS <= 5 #undef INVERT_E5_DIR + #undef E5_DRIVER_TYPE #if E_STEPPERS <= 4 #undef INVERT_E4_DIR + #undef E4_DRIVER_TYPE #if E_STEPPERS <= 3 #undef INVERT_E3_DIR + #undef E3_DRIVER_TYPE #if E_STEPPERS <= 2 #undef INVERT_E2_DIR + #undef E2_DRIVER_TYPE #if E_STEPPERS <= 1 #undef INVERT_E1_DIR + #undef E1_DRIVER_TYPE #if E_STEPPERS == 0 #undef INVERT_E0_DIR + #undef E0_DRIVER_TYPE #endif #endif #endif @@ -733,6 +755,7 @@ #else #define NUM_AXES 1 #endif +#define HAS_X_AXIS 1 #if NUM_AXES >= XY #define HAS_Y_AXIS 1 #if NUM_AXES >= XYZ @@ -767,31 +790,6 @@ #endif #endif -#if E_STEPPERS <= 0 - #undef E0_DRIVER_TYPE -#endif -#if E_STEPPERS <= 1 - #undef E1_DRIVER_TYPE -#endif -#if E_STEPPERS <= 2 - #undef E2_DRIVER_TYPE -#endif -#if E_STEPPERS <= 3 - #undef E3_DRIVER_TYPE -#endif -#if E_STEPPERS <= 4 - #undef E4_DRIVER_TYPE -#endif -#if E_STEPPERS <= 5 - #undef E5_DRIVER_TYPE -#endif -#if E_STEPPERS <= 6 - #undef E6_DRIVER_TYPE -#endif -#if E_STEPPERS <= 7 - #undef E7_DRIVER_TYPE -#endif - #if !HAS_Y_AXIS #undef ENDSTOPPULLUP_YMIN #undef ENDSTOPPULLUP_YMAX @@ -807,7 +805,6 @@ #undef MANUAL_Y_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_Y #undef MAX_SOFTWARE_ENDSTOP_Y - #undef SAFE_BED_LEVELING_START_Y #endif #if !HAS_Z_AXIS @@ -827,7 +824,6 @@ #undef MANUAL_Z_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_Z #undef MAX_SOFTWARE_ENDSTOP_Z - #undef SAFE_BED_LEVELING_START_Z #endif #if !HAS_I_AXIS @@ -844,7 +840,6 @@ #undef MANUAL_I_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_I #undef MAX_SOFTWARE_ENDSTOP_I - #undef SAFE_BED_LEVELING_START_I #endif #if !HAS_J_AXIS @@ -861,7 +856,6 @@ #undef MANUAL_J_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_J #undef MAX_SOFTWARE_ENDSTOP_J - #undef SAFE_BED_LEVELING_START_J #endif #if !HAS_K_AXIS @@ -878,7 +872,6 @@ #undef MANUAL_K_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_K #undef MAX_SOFTWARE_ENDSTOP_K - #undef SAFE_BED_LEVELING_START_K #endif #if !HAS_U_AXIS @@ -895,7 +888,6 @@ #undef MANUAL_U_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_U #undef MAX_SOFTWARE_ENDSTOP_U - #undef SAFE_BED_LEVELING_START_U #endif #if !HAS_V_AXIS @@ -912,7 +904,6 @@ #undef MANUAL_V_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_V #undef MAX_SOFTWARE_ENDSTOP_V - #undef SAFE_BED_LEVELING_START_V #endif #if !HAS_W_AXIS @@ -929,7 +920,6 @@ #undef MANUAL_W_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_W #undef MAX_SOFTWARE_ENDSTOP_W - #undef SAFE_BED_LEVELING_START_W #endif #ifdef X2_DRIVER_TYPE @@ -1621,9 +1611,9 @@ #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) #if ENABLED(TFT_COLOR_UI_PORTRAIT) - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen - #else #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen + #else + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen #endif #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen @@ -1665,7 +1655,9 @@ #endif #endif -#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) +#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) \ + || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) \ + || (HAS_U_AXIS && U_HOME_DIR) || (HAS_V_AXIS && V_HOME_DIR) || (HAS_W_AXIS && W_HOME_DIR) #define HAS_ENDSTOPS 1 #define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H) #else diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 9833b300d368..bfd8caf3dd84 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -86,31 +86,47 @@ #undef PROBE_DEPLOY_STOW_MENU #endif +// Some options are disallowed without required axes +#if !HAS_Y_AXIS + #undef SAFE_BED_LEVELING_START_Y + #undef ARC_SUPPORT + #undef INPUT_SHAPING_Y + #undef SHAPING_FREQ_Y + #undef SHAPING_BUFFER_Y +#endif +#if !HAS_Z_AXIS + #undef SAFE_BED_LEVELING_START_Z +#endif +#if !HAS_I_AXIS + #undef SAFE_BED_LEVELING_START_I +#endif +#if !HAS_J_AXIS + #undef SAFE_BED_LEVELING_START_J +#endif +#if !HAS_K_AXIS + #undef SAFE_BED_LEVELING_START_K +#endif +#if !HAS_U_AXIS + #undef SAFE_BED_LEVELING_START_U +#endif +#if !HAS_V_AXIS + #undef SAFE_BED_LEVELING_START_V +#endif +#if !HAS_W_AXIS + #undef SAFE_BED_LEVELING_START_W +#endif + +// Disallowed with no extruders #if !HAS_EXTRUDERS #define NO_VOLUMETRICS - #undef TEMP_SENSOR_0 - #undef TEMP_SENSOR_1 - #undef TEMP_SENSOR_2 - #undef TEMP_SENSOR_3 - #undef TEMP_SENSOR_4 - #undef TEMP_SENSOR_5 - #undef TEMP_SENSOR_6 - #undef TEMP_SENSOR_7 #undef FWRETRACT #undef PIDTEMP #undef AUTOTEMP #undef PID_EXTRUSION_SCALING #undef LIN_ADVANCE - #undef FILAMENT_RUNOUT_SENSOR #undef ADVANCED_PAUSE_FEATURE - #undef FILAMENT_RUNOUT_DISTANCE_MM - #undef FILAMENT_LOAD_UNLOAD_GCODES - #undef DISABLE_INACTIVE_EXTRUDER #undef FILAMENT_LOAD_UNLOAD_GCODES #undef EXTRUDER_RUNOUT_PREVENT - #undef PREVENT_COLD_EXTRUSION - #undef PREVENT_LENGTHY_EXTRUDE - #undef THERMAL_PROTECTION_HOTENDS #undef THERMAL_PROTECTION_PERIOD #undef WATCH_TEMP_PERIOD #undef SHOW_TEMP_ADC_VALUES @@ -1127,11 +1143,6 @@ #endif // Input shaping -#if !HAS_Y_AXIS - #undef INPUT_SHAPING_Y - #undef SHAPING_FREQ_Y - #undef SHAPING_BUFFER_Y -#endif #if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y) #define HAS_SHAPING 1 #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3faef307a8ae..cf6c560b5cc7 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2250,7 +2250,7 @@ #define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_) #define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_) -#define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M)) +#define _HAS_STOP(A,M) (HAS_##A##_AXIS && PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M)) #if _HAS_STOP(X,MIN) #define HAS_X_MIN 1 #endif @@ -3054,7 +3054,7 @@ */ #if !HAS_FAN #undef ADAPTIVE_FAN_SLOWING - #undef NO_FAN_SLOWING_IN_PID_TUNING + #undef TEMP_TUNING_MAINTAIN_FAN #endif #if !BOTH(HAS_BED_PROBE, HAS_FAN) #undef PROBING_FANS_OFF diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b4e0699403da..dc8c8a22cc36 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -97,6 +97,8 @@ #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." +#elif defined(NO_FAN_SLOWING_IN_PID_TUNING) + #error "NO_FAN_SLOWING_IN_PID_TUNING is now TEMP_TUNING_MAINTAIN_FAN." #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE) #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY." #elif defined(X_HOME_RETRACT_MM) @@ -849,7 +851,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L * Validate that the bed size fits */ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE."); -static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE."); +#if HAS_Y_AXIS + static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE."); +#endif /** * Granular software endstops (Marlin >= 1.1.7) @@ -990,12 +994,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SDSORT_LIMIT must be 256 or smaller." #elif SDSORT_LIMIT < 10 #error "SDSORT_LIMIT should be greater than 9 to be useful." - #elif DISABLED(SDSORT_USES_RAM) - #if ENABLED(SDSORT_DYNAMIC_RAM) - #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." - #elif ENABLED(SDSORT_CACHE_NAMES) - #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." - #endif + #elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_USES_RAM) + #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." + #elif ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_USES_RAM) + #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." + #elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_CACHE_NAMES) + #error "SDSORT_DYNAMIC_RAM requires SDSORT_CACHE_NAMES." #endif #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d6535886bdae..518bbdd1d4cc 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-01-27" + #define STRING_DISTRIBUTION_DATE "2023-02-04" #endif /** diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 03e83c218104..8bdba4234282 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -444,9 +444,12 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } // Prepare strings for progress display -#if HAS_EXTRA_PROGRESS +#if EITHER(HAS_EXTRA_PROGRESS, HAS_PRINT_PROGRESS) static MarlinUI::progress_t progress = 0; static char bufferc[13]; +#endif + +#if HAS_EXTRA_PROGRESS static void prepare_time_string(const duration_t &time, char prefix) { char str[13]; @@ -484,7 +487,8 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (printJobOngoing()) prepare_time_string(print_job_timer.duration(), 'E'); } #endif -#endif // HAS_PRINT_PROGRESS + +#endif // HAS_EXTRA_PROGRESS /** * Draw the Status Screen for a 128x64 DOGM (U8glib) display. diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 0f78e58ef5d7..8894150c9885 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4663,7 +4663,7 @@ void CrealityDWINClass::Start_Print(bool sd) { if (sd) { #if ENABLED(POWER_LOSS_RECOVERY) if (recovery.valid()) { - SdFile *diveDir = nullptr; + MediaFile *diveDir = nullptr; const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename); card.selectFileByName(fname); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e8430d591c98..c45aae6044de 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1347,7 +1347,7 @@ void EachMomentUpdate() { DWINUI::Draw_Button(BTN_Cancel, 26, 280); DWINUI::Draw_Button(BTN_Continue, 146, 280); } - SdFile *dir = nullptr; + MediaFile *dir = nullptr; const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); card.selectFileByName(filename); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 207, card.longest_filename()); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h index eb76bb9b2b2c..9a20c2a038d7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -32,7 +32,7 @@ class MediaFileReader { private: #if ENABLED(SDSUPPORT) - SdFile root, file; + MediaFile root, file; #endif public: diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp index e077eb371ac0..c3927c21a7dd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp @@ -61,9 +61,9 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) { w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), mydata.e_rel[1], canMove(E1)); #if EXTRUDERS > 2 w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), mydata.e_rel[2], canMove(E2)); - #endif - #if EXTRUDERS > 3 - w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), mydata.e_rel[3], canMove(E3)); + #if EXTRUDERS > 3 + w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), mydata.e_rel[3], canMove(E3)); + #endif #endif #endif #if Z_HOME_TO_MIN @@ -79,40 +79,44 @@ bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) { switch (tag) { case 2: UI_DECREMENT_AXIS(X); break; case 3: UI_INCREMENT_AXIS(X); break; - case 4: UI_DECREMENT_AXIS(Y); break; - case 5: UI_INCREMENT_AXIS(Y); break; - case 6: UI_DECREMENT_AXIS(Z); break; - case 7: UI_INCREMENT_AXIS(Z); break; - // For extruders, also update relative distances. - case 8: UI_DECREMENT_AXIS(E0); mydata.e_rel[0] -= increment; break; - case 9: UI_INCREMENT_AXIS(E0); mydata.e_rel[0] += increment; break; - #if HAS_MULTI_EXTRUDER - case 10: UI_DECREMENT_AXIS(E1); mydata.e_rel[1] -= increment; break; - case 11: UI_INCREMENT_AXIS(E1); mydata.e_rel[1] += increment; break; - #endif - #if EXTRUDERS > 2 - case 12: UI_DECREMENT_AXIS(E2); mydata.e_rel[2] -= increment; break; - case 13: UI_INCREMENT_AXIS(E2); mydata.e_rel[2] += increment; break; + #if HAS_EXTRUDERS + // For extruders, also update relative distances. + case 8: UI_DECREMENT_AXIS(E0); mydata.e_rel[0] -= increment; break; + case 9: UI_INCREMENT_AXIS(E0); mydata.e_rel[0] += increment; break; + #if HAS_MULTI_EXTRUDER + case 10: UI_DECREMENT_AXIS(E1); mydata.e_rel[1] -= increment; break; + case 11: UI_INCREMENT_AXIS(E1); mydata.e_rel[1] += increment; break; + #if EXTRUDERS > 2 + case 12: UI_DECREMENT_AXIS(E2); mydata.e_rel[2] -= increment; break; + case 13: UI_INCREMENT_AXIS(E2); mydata.e_rel[2] += increment; break; + #if EXTRUDERS > 3 + case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break; + case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break; + #endif + #endif + #endif #endif - #if EXTRUDERS > 3 - case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break; - case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break; + #if HAS_Y_AXIS + case 4: UI_DECREMENT_AXIS(Y); break; + case 5: UI_INCREMENT_AXIS(Y); break; + case 20: SpinnerDialogBox::enqueueAndWait(F("G28X")); break; + case 21: SpinnerDialogBox::enqueueAndWait(F("G28Y")); break; + #if HAS_Z_AXIS + case 6: UI_DECREMENT_AXIS(Z); break; + case 7: UI_INCREMENT_AXIS(Z); break; + case 22: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break; + case 24: raiseZtoTop(); break; + #endif #endif - case 20: SpinnerDialogBox::enqueueAndWait(F("G28X")); break; - case 21: SpinnerDialogBox::enqueueAndWait(F("G28Y")); break; - case 22: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break; case 23: SpinnerDialogBox::enqueueAndWait(F("G28")); break; - case 24: raiseZtoTop(); break; default: return false; } - #undef UI_DECREMENT_AXIS - #undef UI_INCREMENT_AXIS return true; } void BaseMoveAxisScreen::raiseZtoTop() { - constexpr xyze_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M; + constexpr xyz_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M; setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate.z); } @@ -128,9 +132,11 @@ void BaseMoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_m ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm)); } -void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { - ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); -} +#if HAS_EXTRUDERS + void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { + ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); + } +#endif void MoveAxisScreen::onIdle() { if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { diff --git a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp index a69c54bcff63..a214e7d1e0e7 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp @@ -90,7 +90,7 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { char *cur_name; cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file, *curDir; + MediaFile file, *curDir; card.abortFilePrintNow(); const char * const fname = card.diveToFile(false, curDir, cur_name); if (!fname) return; diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index 6a8333fd66df..b510e3c0c6f3 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -647,8 +647,8 @@ char *creat_title_text() { char *cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file; - SdFile *curDir; + MediaFile file; + MediaFile *curDir; const char * const fname = card.diveToFile(false, curDir, cur_name); if (!fname) return; if (file.open(curDir, fname, O_READ)) { diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index 00bb9833fc72..0c6315d43870 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -727,7 +727,7 @@ void disp_assets_update_progress(FSTR_P const fmsg) { uint8_t mks_test_flag = 0; const char *MKSTestPath = "MKS_TEST"; void mks_test_get() { - SdFile dir, root = card.getroot(); + MediaFile dir, root = card.getroot(); if (dir.open(&root, MKSTestPath, O_RDONLY)) mks_test_flag = 0x1E; } diff --git a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp index c618127980bb..d642d81f6baa 100644 --- a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp @@ -403,8 +403,8 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { #define ASSET_TYPE_TITLE_LOGO 2 #define ASSET_TYPE_G_PREVIEW 3 #define ASSET_TYPE_FONT 4 - static void loadAsset(SdFile &dir, dir_t& entry, FSTR_P const fn, int8_t assetType) { - SdFile file; + static void loadAsset(MediaFile &dir, dir_t& entry, FSTR_P const fn, int8_t assetType) { + MediaFile file; char dosFilename[FILENAME_LENGTH]; createFilename(dosFilename, entry); if (!file.open(&dir, dosFilename, O_READ)) { @@ -488,7 +488,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { void UpdateAssets() { if (!card.isMounted()) return; - SdFile dir, root = card.getroot(); + MediaFile dir, root = card.getroot(); if (dir.open(&root, assetsPath, O_RDONLY)) { disp_assets_update(); diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index 23a39aabc469..a8d30b442a9b 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -736,7 +736,7 @@ int32_t lastFragment = 0; char saveFilePath[50]; -static SdFile upload_file, *upload_curDir; +static MediaFile upload_file, *upload_curDir; static filepos_t pos; int write_to_file(char *buf, int len) { @@ -974,8 +974,8 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if (!gcode_preview_over) { char *cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file; - SdFile *curDir; + MediaFile file; + MediaFile *curDir; card.abortFilePrintNow(); const char * const fname = card.diveToFile(false, curDir, cur_name); if (!fname) return; @@ -1595,7 +1595,7 @@ static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { } } upload_file.close(); - SdFile file, *curDir; + MediaFile file, *curDir; const char * const fname = card.diveToFile(false, curDir, saveFilePath); if (file.open(curDir, fname, O_RDWR)) { gCfgItems.curFilesize = file.fileSize(); @@ -1969,7 +1969,7 @@ void mks_wifi_firmware_update() { if (wifi_upload(0) >= 0) { card.removeFile((char *)ESP_FIRMWARE_FILE_RENAME); - SdFile file, *curDir; + MediaFile file, *curDir; const char * const fname = card.diveToFile(false, curDir, ESP_FIRMWARE_FILE); if (file.open(curDir, fname, O_READ)) { file.rename(curDir, (char *)ESP_FIRMWARE_FILE_RENAME); diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp index c07cc47a3689..18a311303ccf 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp @@ -86,7 +86,7 @@ static const uint32_t defaultTimeout = 500; static const uint32_t eraseTimeout = 15000; static const uint32_t blockWriteTimeout = 200; static const uint32_t blockWriteInterval = 15; // 15ms is long enough, 10ms is mostly too short -static SdFile update_file, *update_curDir; +static MediaFile update_file, *update_curDir; // Messages corresponding to result codes, should make sense when followed by " error" const char *resultMessages[] = { diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index e14e590edac5..866e1fddbb76 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -598,6 +598,8 @@ namespace Language_en { LSTR MSG_TOUCHMI_SAVE = _UxGT("Save"); LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); + LSTR MSG_MANUAL_PENUP = _UxGT("Pen up"); + LSTR MSG_MANUAL_PENDOWN = _UxGT("Pen down"); LSTR MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); LSTR MSG_HOME_FIRST = _UxGT("Home %s First"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Probe Settings"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index a520972b0f7d..ee8d51203c09 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -77,6 +77,7 @@ namespace Language_it { LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); + LSTR MSG_Z_AFTER_HOME = _UxGT("Z dopo homing"); LSTR MSG_FILAMENT_SET = _UxGT("Impostaz.filamento"); LSTR MSG_FILAMENT_MAN = _UxGT("Gestione filamento"); LSTR MSG_MANUAL_LEVELING = _UxGT("Livel.manuale"); @@ -101,6 +102,7 @@ namespace Language_it { LSTR MSG_HOME_OFFSET_Y = _UxGT("Offset home Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Offset home Z"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Err: Troppo lontano!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); LSTR MSG_LAST_VALUE_SP = _UxGT("Ultimo valore "); @@ -128,6 +130,7 @@ namespace Language_it { LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Preris.$ Piatto"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Preris.$ conf"); #endif + LSTR MSG_PREHEAT_HOTEND = _UxGT("Prerisc.Hotend"); LSTR MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); LSTR MSG_COOLDOWN = _UxGT("Raffredda"); @@ -263,6 +266,7 @@ namespace Language_it { LSTR MSG_UBL_INVALID_SLOT = _UxGT("Prima selez. uno slot Mesh"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i caricata"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i salvata"); + LSTR MSG_MESH_ACTIVE = _UxGT("Mesh %i attiva"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Nessuna memoria"); LSTR MSG_UBL_SAVE_ERROR = _UxGT("Err: Salvataggio UBL"); LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ripristino UBL"); @@ -320,6 +324,7 @@ namespace Language_it { LSTR MSG_MOVE_01IN = _UxGT("Muovi di 0.1\""); LSTR MSG_MOVE_05IN = _UxGT("Muovi di 0.5\""); LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); + LSTR MSG_LIVE_MOVE = _UxGT("Modalità Live"); LSTR MSG_SPEED = _UxGT("Velocità"); LSTR MSG_BED_Z = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); @@ -331,6 +336,7 @@ namespace Language_it { LSTR MSG_COOLER = _UxGT("Raffreddam. laser"); LSTR MSG_COOLER_TOGGLE = _UxGT("Alterna raffreddam."); LSTR MSG_FLOWMETER_SAFETY = _UxGT("Sicurezza flusso"); + LSTR MSG_CUTTER = _UxGT("Taglio"); LSTR MSG_LASER = _UxGT("Laser"); LSTR MSG_FAN_SPEED = _UxGT("Vel. ventola"); // Max 15 characters LSTR MSG_FAN_SPEED_N = _UxGT("Vel. ventola ~"); // Max 15 characters @@ -362,14 +368,21 @@ namespace Language_it { LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Calibrazione fallita! Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); - LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Verif.perdita calore"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Riscalda a >200C"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Raffredda a amb."); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); LSTR MSG_MPC_EDIT = _UxGT("Modif.MPC *"); + LSTR MSG_MPC_POWER = _UxGT("Potenza riscald."); LSTR MSG_MPC_POWER_E = _UxGT("Potenza *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("C blocco *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Capacità riscald."); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Capac.riscald. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Reattiv.Sens."); LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H ambiente *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H Amb. vent. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Coeff.ambiente"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Coeff.amb. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Coeff.ventola"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Coeff.ventola *"); LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -398,10 +411,10 @@ namespace Language_it { LSTR MSG_A_RETRACT = _UxGT("A-Ritrazione"); LSTR MSG_A_TRAVEL = _UxGT("A-Spostamento"); LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping"); - LSTR MSG_SHAPING_X_FREQ = _UxGT("Frequenza ") STR_X; - LSTR MSG_SHAPING_Y_FREQ = _UxGT("Frequenza ") STR_Y; - LSTR MSG_SHAPING_X_ZETA = _UxGT("Smorzamento ") STR_X; - LSTR MSG_SHAPING_Y_ZETA = _UxGT("Smorzamento ") STR_Y; + LSTR MSG_SHAPING_ENABLE = _UxGT("Abilita shaping @"); + LSTR MSG_SHAPING_DISABLE = _UxGT("Disabil. shaping @"); + LSTR MSG_SHAPING_FREQ = _UxGT("Frequenza @"); + LSTR MSG_SHAPING_ZETA = _UxGT("Smorzamento @"); LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); LSTR MSG_STEPS_PER_MM = _UxGT("Passi/mm"); @@ -522,6 +535,7 @@ namespace Language_it { LSTR MSG_SINGLENOZZLE_WIPE_RETRACT = _UxGT("Ritrazione pulizia"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Velocità ritrazione"); LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Parcheggia testa"); + LSTR MSG_PARK_FAILED = _UxGT("Parcheggio fallito"); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Veloc. di recupero"); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Velocità ventola"); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Tempo ventola"); @@ -539,6 +553,7 @@ namespace Language_it { LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filam. *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); LSTR MSG_ATTACH_MEDIA = _UxGT("Collega media"); + LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Collega penna USB"); LSTR MSG_CHANGE_MEDIA = _UxGT("Cambia media"); LSTR MSG_RELEASE_MEDIA = _UxGT("Rilascia media"); LSTR MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto"); @@ -622,6 +637,7 @@ namespace Language_it { LSTR MSG_MESH_LEVELING = _UxGT("Livel. Mesh"); LSTR MSG_MESH_DONE = _UxGT("Sond.mesh eseguito"); LSTR MSG_INFO_STATS_MENU = _UxGT("Statistiche"); + LSTR MSG_RESET_STATS = _UxGT("Reset stat.stampa?"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Info. scheda"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Termistori"); LSTR MSG_INFO_EXTRUDERS = _UxGT("Estrusori"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index ef50f5988c92..4167fc802ab9 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -58,7 +58,7 @@ namespace Language_sk { LSTR MSG_MEDIA_INSERTED = _UxGT("Karta vložená"); LSTR MSG_MEDIA_REMOVED = _UxGT("Karta vybraná"); LSTR MSG_MEDIA_WAITING = _UxGT("Čakám na kartu"); - LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Inicial. SD zlyhala"); + LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Inicial.karty zlyhala"); LSTR MSG_MEDIA_READ_ERROR = _UxGT("Chyba čítania karty"); LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB zaria. odstrán."); LSTR MSG_MEDIA_USB_FAILED = _UxGT("Chyba spúšťania USB"); @@ -80,6 +80,7 @@ namespace Language_sk { LSTR MSG_AUTO_HOME_X = _UxGT("Domov os X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Domov os Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); + LSTR MSG_Z_AFTER_HOME = _UxGT("Os Z po domov.poz."); LSTR MSG_FILAMENT_SET = _UxGT("Nastav. filamentu"); LSTR MSG_FILAMENT_MAN = _UxGT("Správa filamentu"); LSTR MSG_MANUAL_LEVELING = _UxGT("Ručné rovnanie"); @@ -104,6 +105,7 @@ namespace Language_sk { LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Chyba: Príliš ďaleko!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); LSTR MSG_SELECT_ORIGIN = _UxGT("Vyberte začiatok"); LSTR MSG_LAST_VALUE_SP = _UxGT("Posl. hodnota "); @@ -131,6 +133,7 @@ namespace Language_sk { LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Zahriať $ podlož"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Zahriať $ nast."); #endif + LSTR MSG_PREHEAT_HOTEND = _UxGT("Zahriať hotend"); LSTR MSG_PREHEAT_CUSTOM = _UxGT("Vlastná teplota"); LSTR MSG_COOLDOWN = _UxGT("Schladiť"); @@ -252,6 +255,7 @@ namespace Language_sk { LSTR MSG_UBL_SMART_FILLIN = _UxGT("Chytré vyplnenie"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Vyplniť mriežku"); LSTR MSG_UBL_MESH_FILLED = _UxGT("Doplnené chýb. body"); + LSTR MSG_UBL_MESH_INVALID = _UxGT("Neplatná sieť"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušiť všetko"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušiť najbližší"); LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Upraviť všetky"); @@ -263,6 +267,7 @@ namespace Language_sk { LSTR MSG_UBL_INVALID_SLOT = _UxGT("Najskôr zvol. slot siete"); LSTR MSG_MESH_LOADED = _UxGT("Sieť %i načítaná"); LSTR MSG_MESH_SAVED = _UxGT("Sieť %i uložená"); + LSTR MSG_MESH_ACTIVE = _UxGT("Sieť %i aktívna"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Nedostatok miesta"); LSTR MSG_UBL_SAVE_ERROR = _UxGT("Chyba: Ukladanie UBL"); LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Chyba: Obnovenie UBL"); @@ -313,11 +318,14 @@ namespace Language_sk { LSTR MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); LSTR MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); + LSTR MSG_MOVE_50MM = _UxGT("Posunúť o 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Posunúť o 100mm"); LSTR MSG_MOVE_0001IN = _UxGT("Posunúť o 0,001in"); LSTR MSG_MOVE_001IN = _UxGT("Posunúť o 0,01in"); LSTR MSG_MOVE_01IN = _UxGT("Posunúť o 0,1in"); + LSTR MSG_MOVE_05IN = _UxGT("Posunúť o 0,5in"); LSTR MSG_MOVE_1IN = _UxGT("Posunúť o 1,0in"); + LSTR MSG_LIVE_MOVE = _UxGT("Živý pohyb"); LSTR MSG_SPEED = _UxGT("Rýchlosť"); LSTR MSG_BED_Z = _UxGT("Výška podl."); LSTR MSG_NOZZLE = _UxGT("Tryska"); @@ -329,6 +337,7 @@ namespace Language_sk { LSTR MSG_COOLER = _UxGT("Chladen. lasera"); LSTR MSG_COOLER_TOGGLE = _UxGT("Prepnúť chladenie"); LSTR MSG_FLOWMETER_SAFETY = _UxGT("Bezpeč. prietok"); + LSTR MSG_CUTTER = _UxGT("Rezačka"); LSTR MSG_LASER = _UxGT("Laser"); LSTR MSG_FAN_SPEED = _UxGT("Rýchlosť vent."); LSTR MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ~"); @@ -361,13 +370,20 @@ namespace Language_sk { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Test. tepl. straty"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Zahriať na >200C"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Schladiť na okolie"); LSTR MSG_MPC_AUTOTUNE = _UxGT("Auto-kal. MPC"); LSTR MSG_MPC_EDIT = _UxGT("Upraviť * MPC"); + LSTR MSG_MPC_POWER = _UxGT("Výkon ohrievača"); LSTR MSG_MPC_POWER_E = _UxGT("Výkon *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Blokovať C *"); - LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Rozliš. senz. *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H okolia *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H vent. okolia *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Tepelná kapacita"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Tepelná kap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Reakcia senzoru"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reakcia senz. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Koef. okolia"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Koef. okolia *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Koef. vent."); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Koef. vent. *"); LSTR MSG_SELECT_E = _UxGT("Vybrať *"); LSTR MSG_ACC = _UxGT("Zrýchlenie"); LSTR MSG_JERK = _UxGT("Skok"); @@ -395,6 +411,11 @@ namespace Language_sk { LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); LSTR MSG_A_TRAVEL = _UxGT("A-prejazd"); + LSTR MSG_INPUT_SHAPING = _UxGT("Tvarov. vstupu"); + LSTR MSG_SHAPING_ENABLE = _UxGT("Povol. tvarov. @"); + LSTR MSG_SHAPING_DISABLE = _UxGT("Zakáz. tvarov. @"); + LSTR MSG_SHAPING_FREQ = _UxGT("Frekvencia @"); + LSTR MSG_SHAPING_ZETA = _UxGT("Tlmenie @"); LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Max. frekvencia"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min. posun"); LSTR MSG_STEPS_PER_MM = _UxGT("Kroky/mm"); @@ -414,6 +435,12 @@ namespace Language_sk { LSTR MSG_FILAMENT_DIAM_E = _UxGT("Priem. fil. *"); LSTR MSG_FILAMENT_UNLOAD = _UxGT("Vysunúť mm"); LSTR MSG_FILAMENT_LOAD = _UxGT("Zaviesť mm"); + LSTR MSG_SEGMENTS_PER_SECOND = _UxGT("Segmentov/sek"); + LSTR MSG_DRAW_MIN_X = _UxGT("Min. X kresby"); + LSTR MSG_DRAW_MAX_X = _UxGT("Max. X kresby"); + LSTR MSG_DRAW_MIN_Y = _UxGT("Min. Y kresby"); + LSTR MSG_DRAW_MAX_Y = _UxGT("Max. Y kresby"); + LSTR MSG_MAX_BELT_LEN = _UxGT("Max. dĺžka pásu"); LSTR MSG_ADVANCE_K = _UxGT("K pre posun"); LSTR MSG_ADVANCE_K_E = _UxGT("K pre posun *"); LSTR MSG_CONTRAST = _UxGT("Kontrast LCD"); @@ -428,7 +455,7 @@ namespace Language_sk { LSTR MSG_ERR_EEPROM_INDEX = _UxGT("Chyba: EEPROM Index"); LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Chyba: Verzia EEPROM"); LSTR MSG_SETTINGS_STORED = _UxGT("Nastavenie uložené"); - LSTR MSG_MEDIA_UPDATE = _UxGT("Aktualizovať z SD"); + LSTR MSG_MEDIA_UPDATE = _UxGT("Aktualiz. z karty"); LSTR MSG_RESET_PRINTER = _UxGT("Reštart. tlačiar."); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnoviť"); LSTR MSG_INFO_SCREEN = _UxGT("Info. obrazovka"); @@ -467,16 +494,28 @@ namespace Language_sk { LSTR MSG_PAUSE_PRINT = _UxGT("Pozastaviť tlač"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Pokročil. pauza"); LSTR MSG_RESUME_PRINT = _UxGT("Obnoviť tlač"); - LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); LSTR MSG_STOP_PRINT = _UxGT("Zastaviť tlač"); - LSTR MSG_END_LOOPS = _UxGT("Koniec opak. sluč."); - LSTR MSG_PRINTING_OBJECT = _UxGT("Tlačím objekt"); - LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); - LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Obnova po výp. nap."); - LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokračovať v úlohe"); - LSTR MSG_MEDIA_MENU = _UxGT("Tlačiť z SD"); - LSTR MSG_NO_MEDIA = _UxGT("Žiadna SD karta"); + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); + LSTR MSG_PRINTING_OBJECT = _UxGT("Tlačím objekt"); + LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); + LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokračovať v úlohe"); + LSTR MSG_MEDIA_MENU = _UxGT("Vytlačiť z karty"); + LSTR MSG_TURN_OFF = _UxGT("Vypnite tlačiareň"); + LSTR MSG_END_LOOPS = _UxGT("Ukončiť opak. sluč."); + #else + LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); + LSTR MSG_PRINTING_OBJECT = _UxGT("Tlačím obj."); + LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť obj."); + LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť obj. ="); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokrač. v úlohe"); + LSTR MSG_MEDIA_MENU = _UxGT("Tlač z karty"); + LSTR MSG_TURN_OFF = _UxGT("Vypnit. teraz"); + LSTR MSG_END_LOOPS = _UxGT("Ukončiť sluč."); + #endif + LSTR MSG_NO_MEDIA = _UxGT("Žiadna karta"); LSTR MSG_DWELL = _UxGT("Spím..."); LSTR MSG_USERWAIT = _UxGT("Pokrač. kliknutím..."); LSTR MSG_PRINT_PAUSED = _UxGT("Tlač pozastavená"); @@ -486,7 +525,6 @@ namespace Language_sk { LSTR MSG_PRINT_ABORTED = _UxGT("Tlač zrušená"); LSTR MSG_PRINT_DONE = _UxGT("Tlač dokončená"); LSTR MSG_PRINTER_KILLED = _UxGT("Tlačiareň zastavená!"); - LSTR MSG_TURN_OFF = _UxGT("Vypnite tlačiareň"); LSTR MSG_NO_MOVE = _UxGT("Žiadny pohyb."); LSTR MSG_KILLED = _UxGT("PRERUŠENÉ. "); LSTR MSG_STOPPED = _UxGT("ZASTAVENÉ. "); @@ -506,8 +544,10 @@ namespace Language_sk { LSTR MSG_TOOL_CHANGE = _UxGT("Výmena nástroja"); LSTR MSG_TOOL_CHANGE_ZLIFT = _UxGT("Zdvihnúť Z"); LSTR MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Primárna rýchl."); + LSTR MSG_SINGLENOZZLE_WIPE_RETRACT = _UxGT("Očist. retrakciou"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Rýchl. retrakcie"); LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Parkovať hlavu"); + LSTR MSG_PARK_FAILED = _UxGT("Hlava sa nedá zapark."); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Rýchl. obnovenia"); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Rýchlosť vent."); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Doba fúkania"); @@ -524,9 +564,14 @@ namespace Language_sk { LSTR MSG_FILAMENTUNLOAD = _UxGT("Vysunúť filament"); LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Vysunúť filament *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Vysunúť všetko"); - LSTR MSG_ATTACH_MEDIA = _UxGT("Načítať SD kartu"); - LSTR MSG_CHANGE_MEDIA = _UxGT("Vymeniť SD kartu"); - LSTR MSG_RELEASE_MEDIA = _UxGT("Odpojiť SD kartu"); + #if ENABLED(MULTI_VOLUME) + LSTR MSG_ATTACH_MEDIA = _UxGT("Načítať SD kartu"); + LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Načítať USB disk"); + #else + LSTR MSG_ATTACH_MEDIA = _UxGT("Načítať kartu"); + #endif + LSTR MSG_CHANGE_MEDIA = _UxGT("Vymeniť kartu"); + LSTR MSG_RELEASE_MEDIA = _UxGT("Odpojiť kartu"); LSTR MSG_ZPROBE_OUT = _UxGT("Sonda Z mimo podl."); LSTR MSG_SKEW_FACTOR = _UxGT("Faktor skosenia"); LSTR MSG_BLTOUCH = _UxGT("BLTouch"); @@ -608,6 +653,7 @@ namespace Language_sk { LSTR MSG_MESH_LEVELING = _UxGT("Mriežkové rovnanie"); LSTR MSG_MESH_DONE = _UxGT("Mriežka dokončená"); LSTR MSG_INFO_STATS_MENU = _UxGT("Štatistika"); + LSTR MSG_RESET_STATS = _UxGT("Vynulovať štatis.?"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Info. o doske"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); LSTR MSG_INFO_EXTRUDERS = _UxGT("Extrudéry"); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 1bd580aa2b34..6ce75d59aeb3 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -360,6 +360,13 @@ void menu_motion() { #endif // + // Pen up/down menu + // + #if ENABLED(PEN_UP_DOWN_MENU) + GCODES_ITEM(MSG_MANUAL_PENUP, F("M280 P0 S90")); + GCODES_ITEM(MSG_MANUAL_PENDOWN, F("M280 P0 S50")); + #endif + // Probe Offset Wizard // #if ENABLED(PROBE_OFFSET_WIZARD) diff --git a/Marlin/src/lcd/tft/tft_color.h b/Marlin/src/lcd/tft/tft_color.h index a8668179e579..07518028aa80 100644 --- a/Marlin/src/lcd/tft/tft_color.h +++ b/Marlin/src/lcd/tft/tft_color.h @@ -178,3 +178,16 @@ #ifndef COLOR_KILL_SCREEN_TEXT #define COLOR_KILL_SCREEN_TEXT COLOR_WHITE #endif + +#ifndef E_BTN_COLOR + #define E_BTN_COLOR COLOR_YELLOW +#endif +#ifndef X_BTN_COLOR + #define X_BTN_COLOR COLOR_CORAL_RED +#endif +#ifndef Y_BTN_COLOR + #define Y_BTN_COLOR COLOR_VIVID_GREEN +#endif +#ifndef Z_BTN_COLOR + #define Z_BTN_COLOR COLOR_LIGHT_BLUE +#endif diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 363e8eaf9925..771f12d89897 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -592,11 +592,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index fa433645d7b2..76cce4dad14e 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -674,11 +674,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 48 #define BTN_HEIGHT 39 #define X_MARGIN 15 diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 5bf50a581843..c4395460d569 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -573,11 +573,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index d440093b169b..7c90ae715986 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -361,7 +361,7 @@ void report_current_position_projected() { // Return true if the given position is within the machine bounds. bool position_is_reachable(const_float_t rx, const_float_t ry) { - if (!COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop)) return false; + if (TERN0(HAS_Y_AXIS, !COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop))) return false; #if ENABLED(DUAL_X_CARRIAGE) if (active_extruder) return COORDINATE_OKAY(rx, X2_MIN_POS - fslop, X2_MAX_POS + fslop); @@ -630,7 +630,7 @@ void do_blocking_move_to(NUM_AXIS_ARGS(const float), const_feedRate_t fr_mm_s/*= if (current_position.z < z) { current_position.z = z; line_to_current_position(z_feedrate); } #endif - current_position.set(x, y); line_to_current_position(xy_feedrate); + current_position.set(x OPTARG(HAS_Y_AXIS, y)); line_to_current_position(xy_feedrate); #if HAS_I_AXIS current_position.i = i; line_to_current_position(i_feedrate); @@ -926,6 +926,8 @@ void restore_feedrate_and_scaling() { #if BOTH(HAS_HOTEND_OFFSET, DELTA) // The effector center position will be the target minus the hotend offset. const xy_pos_t offs = hotend_offset[active_extruder]; + #elif ENABLED(POLARGRAPH) + // POLARGRAPH uses draw_area_* below... #elif ENABLED(POLAR) // For now, we don't limit POLAR #else diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 5d4ccc0a5189..4b0ee355d4cf 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -311,7 +311,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); * public: */ -#if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) +#if ENABLED(TEMP_TUNING_MAINTAIN_FAN) bool Temperature::adaptive_fan_slowing = true; #endif @@ -688,7 +688,7 @@ volatile bool Temperature::raw_temps_ready = false; LEDColor color = ONHEATINGSTART(); #endif - TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = false); LCD_MESSAGE(MSG_HEATING); @@ -876,7 +876,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_DONE)); EXIT_M303: - TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = true); + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); return; } @@ -907,10 +907,10 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_INTERRUPTED)); - return false; + return true; } - return true; + return false; }; struct OnExit { @@ -927,6 +927,8 @@ volatile bool Temperature::raw_temps_ready = false; #endif do_z_clearance(MPC_TUNING_END_Z); + + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); } } on_exit; @@ -935,6 +937,8 @@ volatile bool Temperature::raw_temps_ready = false; MPCHeaterInfo &hotend = temp_hotend[active_extruder]; MPC_t &mpc = hotend.mpc; + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = false); + // Move to center of bed, just above bed height and cool with max fan gcode.home_all_axes(true); disable_all_heaters(); @@ -959,7 +963,7 @@ volatile bool Temperature::raw_temps_ready = false; wait_for_heatup = true; for (;;) { // Can be interrupted with M108 - if (!housekeeping(ms, current_temp, next_report_ms)) return; + if (housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { if (current_temp >= ambient_temp) { @@ -982,15 +986,16 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM(STR_MPC_HEATING_PAST_200); TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_HEATING_PAST_200), LCD_MESSAGE(MSG_HEATING)); hotend.target = 200.0f; // So M105 looks nice - hotend.soft_pwm_amount = MPC_MAX >> 1; + hotend.soft_pwm_amount = (MPC_MAX) >> 1; const millis_t heat_start_time = next_test_ms = ms; celsius_float_t temp_samples[16]; uint8_t sample_count = 0; uint16_t sample_distance = 1; float t1_time = 0; + wait_for_heatup = true; for (;;) { // Can be interrupted with M108 - if (!housekeeping(ms, current_temp, next_report_ms)) return; + if (housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { // Record samples between 100C and 200C @@ -1012,6 +1017,8 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 1000UL * sample_distance; } } + wait_for_heatup = false; + hotend.soft_pwm_amount = 0; // Calculate physical constants from three equally-spaced samples @@ -1045,8 +1052,9 @@ volatile bool Temperature::raw_temps_ready = false; #endif float last_temp = current_temp; + wait_for_heatup = true; for (;;) { // Can be interrupted with M108 - if (!housekeeping(ms, current_temp, next_report_ms)) return; + if (housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1; @@ -1076,6 +1084,7 @@ volatile bool Temperature::raw_temps_ready = false; break; } } + wait_for_heatup = false; const float power_fan0 = total_energy_fan0 * 1000 / test_duration; mpc.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); @@ -4124,6 +4133,7 @@ void Temperature::isr() { } while (wait_for_heatup && TEMP_CONDITIONS); + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; #if HAS_DWIN_E3V2_BASIC @@ -4262,6 +4272,7 @@ void Temperature::isr() { } while (wait_for_heatup && TEMP_BED_CONDITIONS); + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); @@ -4340,6 +4351,7 @@ void Temperature::isr() { } } + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); @@ -4439,6 +4451,7 @@ void Temperature::isr() { } } while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS); + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); @@ -4525,6 +4538,7 @@ void Temperature::isr() { first_loop = false; #endif // TEMP_COOLER_RESIDENCY_TIME > 0 + // Prevent a wait-forever situation if R is misused i.e. M191 R0 if (wants_to_cool) { // Break after MIN_COOLING_SLOPE_TIME_CHAMBER seconds // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER @@ -4537,7 +4551,7 @@ void Temperature::isr() { } while (wait_for_heatup && TEMP_COOLER_CONDITIONS); - // Prevent a wait-forever situation if R is misused i.e. M191 R0 + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 9ac5db44edfa..afbf656a7ab6 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -1162,6 +1162,12 @@ class Temperature { static void auto_job_check_timer(const bool can_start, const bool can_stop); #endif + #if ENABLED(TEMP_TUNING_MAINTAIN_FAN) + static bool adaptive_fan_slowing; + #elif ENABLED(ADAPTIVE_FAN_SLOWING) + static constexpr bool adaptive_fan_slowing = true; + #endif + /** * Perform auto-tuning for hotend or bed in response to M303 */ @@ -1173,12 +1179,6 @@ class Temperature { static void PID_autotune(const celsius_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result=false); - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) - static bool adaptive_fan_slowing; - #elif ENABLED(ADAPTIVE_FAN_SLOWING) - static constexpr bool adaptive_fan_slowing = true; - #endif - // Update the temp manager when PID values change #if ENABLED(PIDTEMP) static void updatePID() { HOTEND_LOOP() temp_hotend[e].pid.reset(); } diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 8ed09417f0df..9448d4f0c5b8 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -163,8 +163,8 @@ #if ENABLED(CR10_STOCKDISPLAY) #define BEEPER_PIN EXP1_01_PIN - #define BTN_ENC EXP1_02_PIN + #define BTN_ENC EXP1_02_PIN #define BTN_EN1 EXP1_03_PIN #define BTN_EN2 EXP1_05_PIN @@ -172,6 +172,37 @@ #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #elif ENABLED(LCD_FOR_MELZI) + + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD for Melzi v4 display requires a custom cable. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif + + /** + * LCD for Melzi v4 needs a custom cable with reversed GND/5V pins; plugging in a standard cable may damage the board or LCD! + * 1. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) + * 2. Swap pin 4 on the Melzi LCD to pin 7 on the SKR Mini E3 EXP1 connector (pin 4 on the SKR is a RESET and cannot be used) + * + * LCD for Melzi V4 SKR Mini E3 V2.0 + * ------ ------ + * LCD RS | 1 2 | EN1 LCD RS | 1 2 | EN1 + * LCD EN | 3 4 | EN2 LCD EN | 3 4 | OPEN (RESET) + * LCD D4 | 5 6 | ENC LCD D4 | 5 6 | ENC + * E-Stop | 7 8 | BEEP EN2 | 7 8 | BEEP + * 5V | 9 10 | GND GND | 9 10 | 5V + * ------ ------ + * EXP1 EXP1 + */ + #define BEEPER_PIN EXP1_08_PIN + + #define BTN_ENC EXP1_06_PIN + #define BTN_EN1 EXP1_02_PIN + #define BTN_EN2 EXP1_07_PIN + + #define LCD_PINS_RS EXP1_01_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING @@ -306,7 +337,7 @@ #define FORCE_SOFT_SPI #else - #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864_V1 are currently supported on the BIGTREE_SKR_MINI_E3." + #error "Only CR10_STOCKDISPLAY, LCD_FOR_MELZI, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864_V1 are currently supported on the BIGTREE_SKR_MINI_E3." #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 1c1e0c7d145a..e3f95623acbc 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1668,6 +1668,28 @@ bool SdBaseFile::remove(SdBaseFile *dirFile, const char *path) { return file.open(dirFile, path, O_WRITE) ? file.remove() : false; } +bool SdBaseFile::hide(const bool hidden) { + if (ENABLED(SDCARD_READONLY)) return false; + // must be an open file or subdirectory + if (!(isFile() || isSubDir())) return false; + // sync() and cache directory entry + sync(); + dir_t *d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); + if (!d) return false; + uint8_t a = d->attributes; + if (hidden) + a |= DIR_ATT_HIDDEN; + else + a &= ~DIR_ATT_HIDDEN; + + if (a != d->attributes) { + d->attributes = a; + return vol_->cacheFlush(); + } + + return true; +} + /** * Rename a file or subdirectory. * diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index bda44c6bd5c3..dd8e2aff4bd4 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -310,6 +310,11 @@ class SdBaseFile { bool rmdir(); bool rmRfStar(); + /** + * Set or clear DIR_ATT_HIDDEN attribute for directory entry + */ + bool hide(const bool hidden); + /** * Set the files position to current position + \a pos. See seekSet(). * \param[in] offset The new position in bytes from the current position. diff --git a/Marlin/src/sd/SdFile.h b/Marlin/src/sd/SdFile.h index 1ff05828d272..81eeadf5b571 100644 --- a/Marlin/src/sd/SdFile.h +++ b/Marlin/src/sd/SdFile.h @@ -53,3 +53,5 @@ class SdFile : public SdBaseFile { void write_P(PGM_P str); void writeln_P(PGM_P str); }; + +using MediaFile = SdFile; diff --git a/Marlin/src/sd/SdVolume.h b/Marlin/src/sd/SdVolume.h index b8e70ca9d7f5..309777303092 100644 --- a/Marlin/src/sd/SdVolume.h +++ b/Marlin/src/sd/SdVolume.h @@ -199,3 +199,5 @@ class SdVolume { bool readBlock(uint32_t block, uint8_t *dst) { return sdCard_->readBlock(block, dst); } bool writeBlock(uint32_t block, const uint8_t *dst) { return sdCard_->writeBlock(block, dst); } }; + +using MarlinVolume = SdVolume; diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 3ec1183083d9..fb2721a2b282 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -79,7 +79,7 @@ IF_DISABLED(NO_SD_AUTOSTART, uint8_t CardReader::autofile_index); // = 0 // private: -SdFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR_DEPTH]; +MediaFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR_DEPTH]; uint8_t CardReader::workDirDepth; #if ENABLED(SDCARD_SORT_ALPHA) @@ -133,8 +133,8 @@ uint8_t CardReader::workDirDepth; #endif DiskIODriver* CardReader::driver = nullptr; -SdVolume CardReader::volume; -SdFile CardReader::file; +MarlinVolume CardReader::volume; +MediaFile CardReader::file; #if HAS_MEDIA_SUBCALLS uint8_t CardReader::file_subcall_ctr; @@ -228,7 +228,7 @@ bool CardReader::is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, // // Get the number of (compliant) items in the folder // -int CardReader::countItems(SdFile dir) { +int CardReader::countItems(MediaFile dir) { dir_t p; int c = 0; while (dir.readDir(&p, longFilename) > 0) @@ -244,7 +244,7 @@ int CardReader::countItems(SdFile dir) { // // Get file/folder info for an item by index // -void CardReader::selectByIndex(SdFile dir, const uint8_t index) { +void CardReader::selectByIndex(MediaFile dir, const uint8_t index) { dir_t p; for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0;) { if (is_visible_entity(p)) { @@ -260,7 +260,7 @@ void CardReader::selectByIndex(SdFile dir, const uint8_t index) { // // Get file/folder info for an item by name // -void CardReader::selectByName(SdFile dir, const char * const match) { +void CardReader::selectByName(MediaFile dir, const char * const match) { dir_t p; for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0; cnt++) { if (is_visible_entity(p)) { @@ -280,7 +280,7 @@ void CardReader::selectByName(SdFile dir, const char * const match) { * this can blow up the stack, so a 'depth' parameter would be a * good addition. */ -void CardReader::printListing(SdFile parent, const char * const prepend, const uint8_t lsflags +void CardReader::printListing(MediaFile parent, const char * const prepend, const uint8_t lsflags OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong/*=nullptr*/) ) { const bool includeTime = TERN0(M20_TIMESTAMP_SUPPORT, TEST(lsflags, LS_TIMESTAMP)); @@ -304,7 +304,7 @@ void CardReader::printListing(SdFile parent, const char * const prepend, const // Get a new directory object using the full path // and dive recursively into it. - SdFile child; // child.close() in destructor + MediaFile child; // child.close() in destructor if (child.open(&parent, dosFilename, O_READ)) { #if ENABLED(LONG_FILENAME_HOST_SUPPORT) if (includeLong) { @@ -375,7 +375,7 @@ void CardReader::ls(const uint8_t lsflags) { // Zero out slashes to make segments for (i = 0; i < pathLen; i++) if (path[i] == '/') path[i] = '\0'; - SdFile diveDir = root; // start from the root for segment 1 + MediaFile diveDir = root; // start from the root for segment 1 for (i = 0; i < pathLen;) { if (path[i] == '\0') i++; // move past a single nul @@ -404,7 +404,7 @@ void CardReader::ls(const uint8_t lsflags) { // SERIAL_ECHOPGM("Opening dir: "); SERIAL_ECHOLN(segment); // Open the sub-item as the new dive parent - SdFile dir; + MediaFile dir; if (!dir.open(&diveDir, segment, O_READ)) { SERIAL_EOL(); SERIAL_ECHO_START(); @@ -604,7 +604,7 @@ void CardReader::getAbsFilenameInCWD(char *dst) { *dst++ = '/'; uint8_t cnt = 1; - auto appendAtom = [&](SdFile &file) { + auto appendAtom = [&](MediaFile &file) { file.getDosName(dst); while (*dst && cnt < MAXPATHNAMELENGTH) { dst++; cnt++; } if (cnt < MAXPATHNAMELENGTH) { *dst = '/'; dst++; cnt++; } @@ -683,7 +683,7 @@ void CardReader::openFileRead(const char * const path, const uint8_t subcall_typ abortFilePrintNow(); - SdFile *diveDir; + MediaFile *diveDir; const char * const fname = diveToFile(true, diveDir, path); if (!fname) return openFailed(path); @@ -719,7 +719,7 @@ void CardReader::openFileWrite(const char * const path) { abortFilePrintNow(); - SdFile *diveDir; + MediaFile *diveDir; const char * const fname = diveToFile(false, diveDir, path); if (!fname) return openFailed(path); @@ -747,7 +747,7 @@ bool CardReader::fileExists(const char * const path) { DEBUG_ECHOLNPGM("fileExists: ", path); // Dive to the file's directory and get the base name - SdFile *diveDir = nullptr; + MediaFile *diveDir = nullptr; const char * const fname = diveToFile(false, diveDir, path); if (!fname) return false; @@ -757,7 +757,7 @@ bool CardReader::fileExists(const char * const path) { //diveDir->close(); // Try to open the file and return the result - SdFile tmpFile; + MediaFile tmpFile; const bool success = tmpFile.open(diveDir, fname, O_READ); if (success) tmpFile.close(); return success; @@ -771,7 +771,7 @@ void CardReader::removeFile(const char * const name) { //abortFilePrintNow(); - SdFile *itsDirPtr; + MediaFile *itsDirPtr; const char * const fname = diveToFile(false, itsDirPtr, name); if (!fname) return; @@ -919,23 +919,23 @@ uint16_t CardReader::countFilesInWorkDir() { * - The workDir points to the last-set navigation target by cd, cdup, cdroot, or diveToFile(true, ...) * * On exit: - * - Your curDir pointer contains an SdFile reference to the file's directory. + * - Your curDir pointer contains an MediaFile reference to the file's directory. * - If update_cwd was 'true' the workDir now points to the file's directory. * * Returns a pointer to the last segment (filename) of the given DOS 8.3 path. - * On exit, inDirPtr contains an SdFile reference to the file's directory. + * On exit, inDirPtr contains an MediaFile reference to the file's directory. * * A nullptr result indicates an unrecoverable error. * * NOTE: End the path with a slash to dive to a folder. In this case the * returned filename will be blank (points to the end of the path). */ -const char* CardReader::diveToFile(const bool update_cwd, SdFile* &inDirPtr, const char * const path, const bool echo/*=false*/) { +const char* CardReader::diveToFile(const bool update_cwd, MediaFile* &inDirPtr, const char * const path, const bool echo/*=false*/) { DEBUG_SECTION(est, "diveToFile", true); // Track both parent and subfolder - static SdFile newDir1, newDir2; - SdFile *sub = &newDir1, *startDirPtr; + static MediaFile newDir1, newDir2; + MediaFile *sub = &newDir1, *startDirPtr; // Parsing the path string const char *atom_ptr = path; @@ -1017,7 +1017,7 @@ const char* CardReader::diveToFile(const bool update_cwd, SdFile* &inDirPtr, con } void CardReader::cd(const char * relpath) { - SdFile newDir, *parent = &getWorkDir(); + MediaFile newDir, *parent = &getWorkDir(); if (newDir.open(parent, relpath, O_READ)) { workDir = newDir; diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 6fe75f760e2d..86acb1b8628c 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -116,7 +116,7 @@ class CardReader { static void changeMedia(DiskIODriver *_driver) { driver = _driver; } - static SdFile getroot() { return root; } + static MediaFile getroot() { return root; } static void mount(); static void release(); @@ -190,12 +190,12 @@ class CardReader { * Relative paths apply to the workDir. * * update_cwd: Pass 'true' to update the workDir on success. - * inDirPtr: On exit your pointer points to the target SdFile. + * inDirPtr: On exit your pointer points to the target MediaFile. * A nullptr indicates failure. * path: Start with '/' for abs path. End with '/' to get a folder ref. * echo: Set 'true' to print the path throughout the loop. */ - static const char* diveToFile(const bool update_cwd, SdFile* &inDirPtr, const char * const path, const bool echo=false); + static const char* diveToFile(const bool update_cwd, MediaFile* &inDirPtr, const char * const path, const bool echo=false); #if ENABLED(SDCARD_SORT_ALPHA) static void presort(); @@ -223,7 +223,7 @@ class CardReader { // Current Working Dir - Set by cd, cdup, cdroot, and diveToFile(true, ...) static char* getWorkDirName() { workDir.getDosName(filename); return filename; } - static SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } + static MediaFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } // Print File stats static uint32_t getFileSize() { return filesize; } @@ -262,7 +262,7 @@ class CardReader { // // Working directory and parents // - static SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; + static MediaFile root, workDir, workDirParents[MAX_DIR_DEPTH]; static uint8_t workDirDepth; // @@ -322,8 +322,8 @@ class CardReader { #endif // SDCARD_SORT_ALPHA static DiskIODriver *driver; - static SdVolume volume; - static SdFile file; + static MarlinVolume volume; + static MediaFile file; static uint32_t filesize, // Total size of the current file, in bytes sdpos; // Index most recently read (one behind file.getPos) @@ -341,10 +341,11 @@ class CardReader { // Directory items // static bool is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, const bool onlyBin=false)); - static int countItems(SdFile dir); - static void selectByIndex(SdFile dir, const uint8_t index); - static void selectByName(SdFile dir, const char * const match); - static void printListing(SdFile parent, const char * const prepend, const uint8_t lsflags + static int countItems(MediaFile dir); + static void selectByIndex(MediaFile dir, const uint8_t index); + static void selectByName(MediaFile dir, const char * const match); + static void printListing( + MediaFile parent, const char * const prepend, const uint8_t lsflags OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong=nullptr) ); diff --git a/Marlin/src/sd/disk_io_driver.h b/Marlin/src/sd/disk_io_driver.h index 02e2b3c73991..3e2d688aea72 100644 --- a/Marlin/src/sd/disk_io_driver.h +++ b/Marlin/src/sd/disk_io_driver.h @@ -22,6 +22,7 @@ #pragma once #include +#include "SdInfo.h" /** * DiskIO Interface diff --git a/Marlin/src/sd/storage.h b/Marlin/src/sd/storage.h new file mode 100644 index 000000000000..3510e04bbe55 --- /dev/null +++ b/Marlin/src/sd/storage.h @@ -0,0 +1,74 @@ +/** + * 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 + +/** + * Marlin Storage Architecture: + * + * DiskIODriver: + * Do all low level IO with the underline hardware or block device: SPI, SDIO, OTG + * + * FilesystemDriver: + * Handle the filesystem format / implementation. Uses the io driver to read and write data. + * Sd2Card is the very first and current filesystem implementation on Marlin, supporting FAT. + * FatFS - Work in progress. + * + * + * Marlin Abstractions: + * + * Using this names allow us to isolate filesystem driver code, keeping all Marlin code agnostic. + * + * MediaFilesystem: + * Abstraction of systemwide filesystem operation. + * + * MarlinVolume: + * Abstraction of a filesystem volume. + * + * MediaFile: + * Abstraction of a generic file. Using this name allow us to isolate filesystem driver code, + * keeping all Marlin code agnostic. + * + * PrintFromStorage: + * Class to handle printing from any attached storage. + * + */ + +/* + +Interface definition. Doesn't need to be compiled, as we use duck typing, +allowing drivers to just use type alias. + +Class MarlinVolume { +public: +}; + +Class MediaFile { +public: +}; + +Class MediaFilesystem { +public: + static void init(); + static MarlinVolume* openVolume(const char *); +}; + +*/ diff --git a/buildroot/bin/run_tests b/buildroot/bin/run_tests index 26284fa69330..9a03be3cc734 100755 --- a/buildroot/bin/run_tests +++ b/buildroot/bin/run_tests @@ -67,7 +67,7 @@ else printf "\033[0;32mMatching test \033[0m#$3\033[0;32m: '\033[0m$test_name\033[0;32m'\n" fi fi - $TESTS/$2 $1 $2 "$test_name" + "$TESTS/$2" $1 $2 "$test_name" if [[ $GIT_RESET_HARD == "true" ]]; then git reset --hard HEAD else diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index d752ebc2c828..42fc91038ecc 100644 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -85,13 +85,12 @@ def apply_opt(name, val, conf=None): # Return True if any files were fetched. def fetch_example(url): if url.endswith("/"): url = url[:-1] - if url.startswith('http'): - url = url.replace("%", "%25").replace(" ", "%20") - else: + if not url.startswith('http'): brch = "bugfix-2.1.x" - if '@' in path: path, brch = map(str.strip, path.split('@')) + if '@' in url: url, brch = map(str.strip, url.split('@')) url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}" - + url = url.replace("%", "%25").replace(" ", "%20") + # Find a suitable fetch command if shutil.which("curl") is not None: fetch = "curl -L -s -S -f -o" diff --git a/buildroot/tests/LPC1768 b/buildroot/tests/LPC1768 index 535e776a3892..2e680b60d797 100755 --- a/buildroot/tests/LPC1768 +++ b/buildroot/tests/LPC1768 @@ -40,7 +40,7 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EEB \ NOZZLE_CLEAN_MIN_TEMP 170 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \ FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \ NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \ diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index 086dffffc92c..ec5c824450c6 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -18,7 +18,7 @@ opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \ GRID_MAX_POINTS_X 16 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" -opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ +opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \ MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BED_TRAMMING_USE_PROBE BED_TRAMMING_VERIFY_RAISED \