update code base to Marlin 2.0.9.2

This commit is contained in:
Stefan Kalscheuer
2021-10-03 18:57:12 +02:00
parent b9d7ba838e
commit 7077da3591
2617 changed files with 332093 additions and 103438 deletions

45
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Executable file → Normal file
View File

@@ -16,7 +16,7 @@
* 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 <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
@@ -28,16 +28,17 @@
#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
#include "menu.h"
#include "menu_item.h"
#include "../../module/delta.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#include "../extui/ui_api.h"
#endif
void _man_probe_pt(const xy_pos_t &xy) {
@@ -46,15 +47,16 @@ void _man_probe_pt(const xy_pos_t &xy) {
do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES);
ui.wait_for_move = false;
ui.synchronize();
move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT));
ui.manual_move.menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / planner.settings.axis_steps_per_mm[0]); // Use first axis as for delta XYZ should always match
ui.goto_screen(lcd_move_z);
}
}
#if ENABLED(DELTA_AUTO_CALIBRATION)
#include "../../gcode/gcode.h"
#if HAS_RESUME_CONTINUE
#include "../../MarlinCore.h" // for wait_for_user_response()
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
#include "../../feature/host_actions.h" // for host_prompt_do
#endif
@@ -62,13 +64,9 @@ void _man_probe_pt(const xy_pos_t &xy) {
float lcd_probe_pt(const xy_pos_t &xy) {
_man_probe_pt(xy);
ui.defer_status_screen();
#if ENABLED(HOST_PROMPT_SUPPORT)
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR);
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress"));
#endif
wait_for_user_response();
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress")));
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
ui.goto_previous_screen_no_defer();
return current_position.z;
}
@@ -89,9 +87,10 @@ void _man_probe_pt(const xy_pos_t &xy) {
ui.goto_screen(_lcd_calibrate_homing);
}
void _goto_tower_a(const float &a) {
void _goto_tower_a(const_float_t a) {
constexpr float dcr = DELTA_PRINTABLE_RADIUS;
xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) };
_man_probe_pt(tower_vec * delta_calibration_radius());
_man_probe_pt(tower_vec * dcr);
}
void _goto_tower_x() { _goto_tower_a(210); }
void _goto_tower_y() { _goto_tower_a(330); }
@@ -102,15 +101,13 @@ void _man_probe_pt(const xy_pos_t &xy) {
void lcd_delta_settings() {
auto _recalc_delta_settings = []{
#if HAS_LEVELING
reset_bed_level(); // After changing kinematics bed-level data is no longer valid
#endif
TERN_(HAS_LEVELING, reset_bed_level()); // After changing kinematics bed-level data is no longer valid
recalc_delta_settings();
};
START_MENU();
BACK_ITEM(MSG_DELTA_CALIBRATE);
EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings);
#define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 5, _recalc_delta_settings)
#define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings)
EDIT_ENDSTOP_ADJ("Ex", a);
EDIT_ENDSTOP_ADJ("Ey", b);
EDIT_ENDSTOP_ADJ("Ez", c);
@@ -124,14 +121,18 @@ void lcd_delta_settings() {
}
void menu_delta_calibrate() {
#if ENABLED(DELTA_CALIBRATION_MENU)
const bool all_homed = all_axes_homed(); // Acquire ahead of loop
#endif
START_MENU();
BACK_ITEM(MSG_MAIN);
#if ENABLED(DELTA_AUTO_CALIBRATION)
GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings);
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
#endif
#endif
@@ -139,7 +140,7 @@ void menu_delta_calibrate() {
#if ENABLED(DELTA_CALIBRATION_MENU)
SUBMENU(MSG_AUTO_HOME, _lcd_delta_calibrate_home);
if (all_axes_homed()) {
if (all_homed) {
SUBMENU(MSG_DELTA_CALIBRATE_X, _goto_tower_x);
SUBMENU(MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
SUBMENU(MSG_DELTA_CALIBRATE_Z, _goto_tower_z);