Merge upstream changes from Marlin 2.1.1

This commit is contained in:
Stefan Kalscheuer
2022-09-03 09:23:32 +02:00
parent 626283aadb
commit 986e416c7f
1610 changed files with 73839 additions and 40857 deletions

View File

@@ -39,23 +39,13 @@
#include "../../feature/bedlevel/bedlevel.h"
#endif
void _goto_manual_move_z(const_float_t);
// Global storage
float z_offset_backup, calculated_z_offset, z_offset_ref;
#if HAS_LEVELING
bool leveling_was_active;
#endif
inline void z_clearance_move() {
do_z_clearance(
#ifdef Z_AFTER_HOMING
Z_AFTER_HOMING
#elif defined(Z_HOMING_HEIGHT)
Z_HOMING_HEIGHT
#else
10
#endif
);
do_z_clearance(Z_POST_CLEARANCE);
}
void set_offset_and_go_back(const_float_t z) {
@@ -65,11 +55,6 @@ void set_offset_and_go_back(const_float_t z) {
ui.goto_previous_screen_no_defer();
}
void _goto_manual_move_z(const_float_t scale) {
ui.manual_move.menu_scale = scale;
ui.goto_screen(lcd_move_z);
}
void probe_offset_wizard_menu() {
START_MENU();
calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref;
@@ -77,27 +62,14 @@ void probe_offset_wizard_menu() {
if (LCD_HEIGHT >= 4)
STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT);
STATIC_ITEM_P(PSTR("Z="), SS_CENTER, ftostr42_52(current_position.z));
STATIC_ITEM_F(F("Z"), SS_CENTER, ftostr42_52(current_position.z));
STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset));
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); });
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); });
if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) {
char tmp[20], numstr[10];
// Determine digits needed right of decimal
const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 :
!UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2;
sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
#if DISABLED(HAS_GRAPHICAL_TFT)
SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
lcd_put_u8str(tmp);
MENU_ITEM_ADDON_END();
#else
SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
#endif
}
if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f)
SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
ACTION_ITEM(MSG_BUTTON_DONE, []{
set_offset_and_go_back(calculated_z_offset);
@@ -111,7 +83,7 @@ void probe_offset_wizard_menu() {
// If wizard-homing was done by probe with PROBE_OFFSET_WIZARD_START_Z
#if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
queue.inject_P(PSTR("G28Z"));
queue.inject(F("G28Z"));
#else // Otherwise do a Z clearance move like after Homing
z_clearance_move();
#endif
@@ -122,7 +94,7 @@ void probe_offset_wizard_menu() {
void prepare_for_probe_offset_wizard() {
#if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE
if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING));
if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT_F(MSG_PROBE_WIZARD_PROBING));
if (ui.wait_for_move) return;
@@ -148,7 +120,7 @@ void prepare_for_probe_offset_wizard() {
ui.wait_for_move = true;
current_position += probe.offset_xy;
line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE));
ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING));
ui.synchronize(GET_TEXT_F(MSG_PROBE_WIZARD_MOVING));
ui.wait_for_move = false;
SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement