Merge upstream changes from Marlin 2.1.2.3

This commit is contained in:
Stefan Kalscheuer
2024-05-29 18:50:07 +02:00
parent 5c1cebc7d4
commit 35b6573a54
20 changed files with 104 additions and 91 deletions

View File

@@ -35,7 +35,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02010202
#define CONFIGURATION_H_VERSION 02010203
#define ANYCUBIC_TOUCHSCREEN
#define KNUTWURST_SPECIAL_MENU
// #define ANYCUBIC_TFT_DEBUG
@@ -802,6 +802,7 @@
#else
#define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current
#endif
/**
* Model Predictive Control for hotend
*
@@ -1851,8 +1852,6 @@
// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
// #define PROBING_MARGIN 10
#if ENABLED(KNUTWURST_CHIRON)
#define PROBING_MARGIN 15
#else
@@ -4015,10 +4014,10 @@
#define SERVO_DELAY { 300 }
// Only power servos during movement, otherwise leave off to prevent jitter
// #define DEACTIVATE_SERVOS_AFTER_MOVE
//#define DEACTIVATE_SERVOS_AFTER_MOVE
// Edit servo angles with M281 and save to EEPROM with M500
// #define EDITABLE_SERVO_ANGLES
//#define EDITABLE_SERVO_ANGLES
// Disable servo with M282 to reduce power consumption, noise, and heat when not in use
// #define SERVO_DETACH_GCODE
//#define SERVO_DETACH_GCODE

View File

@@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02010202
#define CONFIGURATION_ADV_H_VERSION 02010203
// @section develop
@@ -1191,11 +1191,11 @@
* XY Frequency limit
* Reduce resonance by limiting the frequency of small zigzag infill moves.
* See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html
* Use M201 F<freq> G<min%> to change limits at runtime.
* Use M201 F<freq> S<min%> to change limits at runtime.
*/
//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>.
#ifdef XY_FREQUENCY_LIMIT
#define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 G<min%>.
#define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 S<min%>.
#endif
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
@@ -4195,7 +4195,7 @@
* Extras for an ESP32-based motherboard with WIFISUPPORT
* These options don't apply to add-on WiFi modules based on ESP32 WiFi101.
*/
#if ENABLED(WIFISUPPORT)
#if ANY(WIFISUPPORT, ESP3D_WIFISUPPORT)
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS
//#define OTASUPPORT // Support over-the-air firmware updates
//#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host

View File

@@ -28,7 +28,7 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "2.1.2.2"
//#define SHORT_BUILD_VERSION "2.1.2.3"
/**
* Verbose version identifier which should contain a reference to the location
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-02-08"
//#define STRING_DISTRIBUTION_DATE "2024-05-29"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.

View File

@@ -679,7 +679,7 @@
#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()()
// Force define expansion
#define EVAL EVAL16
#define EVAL(V...) EVAL16(V)
#define EVAL4096(V...) EVAL2048(EVAL2048(V))
#define EVAL2048(V...) EVAL1024(EVAL1024(V))
#define EVAL1024(V...) EVAL512(EVAL512(V))

View File

@@ -451,7 +451,7 @@ struct XYval {
// Length reduced to one dimension
FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); }
// Pointer to the data as a simple array
FI operator T* () { return pos; }
explicit FI operator T* () { return pos; }
// If any element is true then it's true
FI constexpr operator bool() const { return x || y; }
// Smallest element
@@ -601,7 +601,7 @@ struct XYZval {
// Length reduced to one dimension
FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); }
// Pointer to the data as a simple array
FI operator T* () { return pos; }
explicit FI operator T* () { return pos; }
// If any element is true then it's true
FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element
@@ -749,7 +749,7 @@ struct XYZEval {
// Length reduced to one dimension
FI constexpr 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
FI operator T* () { return pos; }
explicit FI operator T* () { return pos; }
// If any element is true then it's true
FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element

View File

@@ -31,6 +31,10 @@
#include "powerloss.h"
#include "../core/macros.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
#endif
bool PrintJobRecovery::enabled; // Initialized by settings.load()
MediaFile PrintJobRecovery::file;

View File

@@ -456,6 +456,7 @@
#endif
#ifdef Y2_DRIVER_TYPE
#define HAS_Y2_STEPPER 1
#define HAS_DUAL_Y_STEPPERS 1
#endif
/**

View File

@@ -2852,7 +2852,7 @@
#ifndef PROBE_OFFSET_YMAX
#define PROBE_OFFSET_YMAX 50
#endif
#if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE)
#if ALL(ENDSTOPPULLUPS, HAS_Z_MIN_PROBE_PIN)
#define ENDSTOPPULLUP_ZMIN_PROBE
#endif
#ifndef XY_PROBE_FEEDRATE

View File

@@ -3679,11 +3679,11 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#if !(defined(WIFI_SSID) && defined(WIFI_PWD))
#error "ESP32 motherboard with WIFISUPPORT requires WIFI_SSID and WIFI_PWD."
#endif
#elif ENABLED(WIFI_CUSTOM_COMMAND)
#elif ENABLED(WIFI_CUSTOM_COMMAND) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
#error "WIFI_CUSTOM_COMMAND requires an ESP32 motherboard and WIFISUPPORT."
#elif ENABLED(OTASUPPORT)
#elif ENABLED(OTASUPPORT) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
#error "OTASUPPORT requires an ESP32 motherboard and WIFISUPPORT."
#elif defined(WIFI_SSID) || defined(WIFI_PWD)
#elif (defined(WIFI_SSID) || defined(WIFI_PWD)) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT)
#error "WIFI_SSID and WIFI_PWD only apply to ESP32 motherboard with WIFISUPPORT."
#endif

View File

@@ -25,7 +25,7 @@
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "2.1.2.2"
#define SHORT_BUILD_VERSION "2.1.2.3"
#endif
/**
@@ -41,10 +41,10 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
#define CUSTOM_BUILD_VERSION "1.5.4"
#define CUSTOM_BUILD_VERSION "1.5.4"
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-03-22"
#define STRING_DISTRIBUTION_DATE "2024-05-29"
#endif
/**
@@ -54,7 +54,7 @@
* to alert users to major changes.
*/
#define MARLIN_HEX_VERSION 02010202
#define MARLIN_HEX_VERSION 02010203
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif
@@ -94,10 +94,10 @@
#define DEFAULT_MACHINE_UUID "b6153152-86fb-4cd8-bda7-91c6a04c467d" // PATCH: Knutwurst
#endif
/**
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release. Displayed in the Info Menu.
*/
/**
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release. Displayed in the Info Menu.
*/
#ifndef WEBSITE_URL
#define WEBSITE_URL "marlinfw.org"
#endif

View File

@@ -567,6 +567,7 @@ namespace Language_en {
#else
LSTR MSG_ATTACH_MEDIA = _UxGT("Attach ") MEDIA_TYPE_EN;
#endif
LSTR MSG_ATTACH_SD_MEDIA = _UxGT("Attach SD Card");
LSTR MSG_CHANGE_MEDIA = _UxGT("Change ") MEDIA_TYPE_EN;
LSTR MSG_RELEASE_MEDIA = _UxGT("Release ") MEDIA_TYPE_EN;
LSTR MSG_ZPROBE_OUT = _UxGT("Z Probe Past Bed");

View File

@@ -233,12 +233,11 @@ void menu_configuration();
#endif
void menu_main() {
const bool busy = printingIsActive()
#if HAS_MEDIA
, card_detected = card.isMounted()
, card_open = card_detected && card.isFileOpen()
#endif
;
const bool busy = printingIsActive();
#if HAS_MEDIA
const bool card_detected = card.isMounted(),
card_open = card_detected && card.isFileOpen();
#endif
START_MENU();
BACK_ITEM(MSG_INFO_SCREEN);
@@ -275,12 +274,12 @@ void menu_main() {
else {
#if ALL(HAS_MEDIA, MEDIA_MENU_AT_TOP)
// BEGIN MEDIA MENU
#if ENABLED(MENU_ADDAUTOSTART)
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
#endif
if (card_detected) {
if (!card_open) {
#if ENABLED(MENU_ADDAUTOSTART)
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
#endif
#if HAS_SD_DETECT
GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Change Media
#if ENABLED(MULTI_VOLUME)
@@ -392,12 +391,12 @@ void menu_main() {
#if HAS_MEDIA && DISABLED(MEDIA_MENU_AT_TOP)
// BEGIN MEDIA MENU
#if ENABLED(MENU_ADDAUTOSTART)
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
#endif
if (card_detected) {
if (!card_open) {
#if ENABLED(MENU_ADDAUTOSTART)
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
#endif
#if HAS_SD_DETECT
GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Change Media
#if ENABLED(MULTI_VOLUME)

View File

@@ -2046,6 +2046,7 @@ void prepare_line_to_destination() {
do_homing_move(axis, -bump, TERN(HOMING_Z_WITH_PROBE, (axis == Z_AXIS ? z_probe_fast_mm_s : 0), 0), false);
#if ENABLED(DETECT_BROKEN_ENDSTOP)
// Check for a broken endstop
EndstopEnum es;
switch (axis) {
@@ -2053,11 +2054,20 @@ void prepare_line_to_destination() {
MAIN_AXIS_MAP(_ESCASE)
default: break;
}
#if ENABLED(DUAL_X_CARRIAGE)
if (axis == X_AXIS && axis_home_dir > 0) {
es = X_MAX;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("DUAL_X_CARRIAGE: Homing to X_MAX");
}
#endif
if (TEST(endstops.state(), es)) {
SERIAL_ECHO_MSG("Bad ", C(AXIS_CHAR(axis)), " Endstop?");
kill(GET_TEXT_F(MSG_KILL_HOMING_FAILED));
}
#endif
#endif // DETECT_BROKEN_ENDSTOP
#if ALL(HOMING_Z_WITH_PROBE, BLTOUCH)
if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy())

View File

@@ -2333,7 +2333,8 @@ uint32_t Stepper::block_phase_isr() {
*/
if (cutter.cutter_mode == CUTTER_MODE_DYNAMIC
&& planner.laser_inline.status.isPowered // isPowered flag set on any parsed G1, G2, G3, or G5 move; cleared on any others.
&& cutter.last_block_power != current_block->laser.power // Prevent constant update without change
&& current_block // Block may not be available if steps completed (see discard_current_block() above)
&& cutter.last_block_power != current_block->laser.power // Only update if the power changed
) {
cutter.apply_power(current_block->laser.power);
cutter.last_block_power = current_block->laser.power;
@@ -3952,22 +3953,22 @@ void Stepper::report_positions() {
break;
#endif
#if HAS_I_MS_PINS
case I_AXIS: WRITE(I_MS1_PIN, ms1); break
case I_AXIS: WRITE(I_MS1_PIN, ms1); break;
#endif
#if HAS_J_MS_PINS
case J_AXIS: WRITE(J_MS1_PIN, ms1); break
case J_AXIS: WRITE(J_MS1_PIN, ms1); break;
#endif
#if HAS_K_MS_PINS
case K_AXIS: WRITE(K_MS1_PIN, ms1); break
case K_AXIS: WRITE(K_MS1_PIN, ms1); break;
#endif
#if HAS_U_MS_PINS
case U_AXIS: WRITE(U_MS1_PIN, ms1); break
case U_AXIS: WRITE(U_MS1_PIN, ms1); break;
#endif
#if HAS_V_MS_PINS
case V_AXIS: WRITE(V_MS1_PIN, ms1); break
case V_AXIS: WRITE(V_MS1_PIN, ms1); break;
#endif
#if HAS_W_MS_PINS
case W_AXIS: WRITE(W_MS1_PIN, ms1); break
case W_AXIS: WRITE(W_MS1_PIN, ms1); break;
#endif
#if HAS_E0_MS_PINS
case E_AXIS: WRITE(E0_MS1_PIN, ms1); break;
@@ -4032,22 +4033,22 @@ void Stepper::report_positions() {
break;
#endif
#if HAS_I_MS_PINS
case I_AXIS: WRITE(I_MS2_PIN, ms2); break
case I_AXIS: WRITE(I_MS2_PIN, ms2); break;
#endif
#if HAS_J_MS_PINS
case J_AXIS: WRITE(J_MS2_PIN, ms2); break
case J_AXIS: WRITE(J_MS2_PIN, ms2); break;
#endif
#if HAS_K_MS_PINS
case K_AXIS: WRITE(K_MS2_PIN, ms2); break
case K_AXIS: WRITE(K_MS2_PIN, ms2); break;
#endif
#if HAS_U_MS_PINS
case U_AXIS: WRITE(U_MS2_PIN, ms2); break
case U_AXIS: WRITE(U_MS2_PIN, ms2); break;
#endif
#if HAS_V_MS_PINS
case V_AXIS: WRITE(V_MS2_PIN, ms2); break
case V_AXIS: WRITE(V_MS2_PIN, ms2); break;
#endif
#if HAS_W_MS_PINS
case W_AXIS: WRITE(W_MS2_PIN, ms2); break
case W_AXIS: WRITE(W_MS2_PIN, ms2); break;
#endif
#if HAS_E0_MS_PINS
case E_AXIS: WRITE(E0_MS2_PIN, ms2); break;
@@ -4111,23 +4112,23 @@ void Stepper::report_positions() {
#endif
break;
#endif
#if HAS_I_MS_PINS
case I_AXIS: WRITE(I_MS3_PIN, ms3); break
#if HAS_I_MS_PINS && PIN_EXISTS(I_MS3)
case I_AXIS: WRITE(I_MS3_PIN, ms3); break;
#endif
#if HAS_J_MS_PINS
case J_AXIS: WRITE(J_MS3_PIN, ms3); break
#if HAS_J_MS_PINS && PIN_EXISTS(J_MS3)
case J_AXIS: WRITE(J_MS3_PIN, ms3); break;
#endif
#if HAS_K_MS_PINS
case K_AXIS: WRITE(K_MS3_PIN, ms3); break
#if HAS_K_MS_PINS && PIN_EXISTS(K_MS3)
case K_AXIS: WRITE(K_MS3_PIN, ms3); break;
#endif
#if HAS_U_MS_PINS
case U_AXIS: WRITE(U_MS3_PIN, ms3); break
#if HAS_U_MS_PINS && PIN_EXISTS(U_MS3)
case U_AXIS: WRITE(U_MS3_PIN, ms3); break;
#endif
#if HAS_V_MS_PINS
case V_AXIS: WRITE(V_MS3_PIN, ms3); break
#if HAS_V_MS_PINS && PIN_EXISTS(V_MS3)
case V_AXIS: WRITE(V_MS3_PIN, ms3); break;
#endif
#if HAS_W_MS_PINS
case W_AXIS: WRITE(W_MS3_PIN, ms3); break
#if HAS_W_MS_PINS && PIN_EXISTS(W_MS3)
case W_AXIS: WRITE(W_MS3_PIN, ms3); break;
#endif
#if HAS_E0_MS_PINS && PIN_EXISTS(E0_MS3)
case E_AXIS: WRITE(E0_MS3_PIN, ms3); break;

View File

@@ -595,7 +595,7 @@ volatile bool Temperature::raw_temps_ready = false;
#endif
#if MILLISECONDS_PREHEAT_TIME > 0
millis_t Temperature::preheat_end_ms_hotend[HOTENDS]; // = { 0 };
millis_t Temperature::preheat_end_ms_hotend[HOTENDS]; // = { 0 }
#endif
#if HAS_HEATED_BED && PREHEAT_TIME_BED_MS > 0
millis_t Temperature::preheat_end_ms_bed = 0;
@@ -1814,7 +1814,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
// Make sure temperature is decreasing
if (watch_cooler.elapsed(ms)) { // Time to check the cooler?
if (degCooler() > watch_cooler.target) // Failed to decrease enough?
_temp_error(H_COOLER, GET_TEXT_F(MSG_COOLING_FAILED), GET_TEXT_F(MSG_COOLING_FAILED));
_temp_error(H_COOLER, GET_EN_TEXT_F(MSG_COOLING_FAILED), GET_TEXT_F(MSG_COOLING_FAILED));
else
start_watching_cooler(); // Start again if the target is still far off
}
@@ -2442,7 +2442,7 @@ void Temperature::updateTemperaturesFromRawValues() {
/**
// DEBUG PREHEATING TIME
SERIAL_ECHOLNPGM("\nExtruder = ", e, " Preheat On/Off = ", is_preheating(e));
const float test_is_preheating = (preheat_end_time[HOTEND_INDEX] - millis()) * 0.001f;
const float test_is_preheating = (preheat_end_ms_hotend[HOTEND_INDEX] - millis()) * 0.001f;
if (test_is_preheating < 31) SERIAL_ECHOLNPGM("Extruder = ", e, " Preheat remaining time = ", test_is_preheating, "s", "\n");
//*/

View File

@@ -747,7 +747,7 @@ class Temperature {
#endif
#if MILLISECONDS_PREHEAT_TIME > 0
static millis_t preheat_end_time[HOTENDS];
static millis_t preheat_end_ms_hotend[HOTENDS];
#endif
#if HAS_FAN_LOGIC
@@ -909,13 +909,13 @@ class Temperature {
*/
#if MILLISECONDS_PREHEAT_TIME > 0
static bool is_preheating(const uint8_t E_NAME) {
return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]);
return preheat_end_ms_hotend[HOTEND_INDEX] && PENDING(millis(), preheat_end_ms_hotend[HOTEND_INDEX]);
}
static void start_preheat_time(const uint8_t E_NAME) {
preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME;
preheat_end_ms_hotend[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME;
}
static void reset_preheat_time(const uint8_t E_NAME) {
preheat_end_time[HOTEND_INDEX] = 0;
preheat_end_ms_hotend[HOTEND_INDEX] = 0;
}
#else
#define is_preheating(n) (false)