|
|
@ -207,7 +207,7 @@ CrealityDWINClass CrealityDWIN; |
|
|
|
|
|
|
|
void manual_value_update(bool undefined=false) { |
|
|
|
sprintf_P(cmd, PSTR("M421 I%i J%i Z%s %s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1), undefined ? "N" : ""); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
} |
|
|
|
|
|
|
@ -267,7 +267,7 @@ CrealityDWINClass CrealityDWIN; |
|
|
|
|
|
|
|
void manual_value_update() { |
|
|
|
sprintf_P(cmd, PSTR("G29 I%i J%i Z%s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
} |
|
|
|
|
|
|
@ -283,9 +283,9 @@ CrealityDWINClass CrealityDWIN; |
|
|
|
else { |
|
|
|
CrealityDWIN.Popup_Handler(MoveWait); |
|
|
|
sprintf_P(cmd, PSTR("G0 F300 Z%s"), dtostrf(Z_CLEARANCE_BETWEEN_PROBES, 1, 3, str_1)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
sprintf_P(cmd, PSTR("G42 F4000 I%i J%i"), mesh_x, mesh_y); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; |
|
|
|
planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); |
|
|
@ -1132,7 +1132,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
} |
|
|
|
Popup_Handler(FilChange); |
|
|
|
sprintf_P(cmd, PSTR("M600 B1 R%i"), thermalManager.temp_hotend[0].target); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
} |
|
|
|
#endif |
|
|
|
} |
|
|
@ -1172,7 +1172,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_MoveX, F("Home X")); |
|
|
|
else { |
|
|
|
Popup_Handler(Home); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G28 X")); |
|
|
|
gcode.process_subcommands_now(F("G28 X")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1182,7 +1182,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_MoveY, F("Home Y")); |
|
|
|
else { |
|
|
|
Popup_Handler(Home); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G28 Y")); |
|
|
|
gcode.process_subcommands_now(F("G28 Y")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1192,7 +1192,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_MoveZ, F("Home Z")); |
|
|
|
else { |
|
|
|
Popup_Handler(Home); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G28 Z")); |
|
|
|
gcode.process_subcommands_now(F("G28 Z")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1201,7 +1201,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (draw) |
|
|
|
Draw_Menu_Item(row, ICON_SetHome, F("Set Home Position")); |
|
|
|
else { |
|
|
|
gcode.process_subcommands_now_P(PSTR("G92 X0 Y0 Z0")); |
|
|
|
gcode.process_subcommands_now(F("G92 X0 Y0 Z0")); |
|
|
|
AudioFeedback(); |
|
|
|
} |
|
|
|
break; |
|
|
@ -1366,14 +1366,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (use_probe) { |
|
|
|
#if HAS_BED_PROBE |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s"), dtostrf(PROBE_X_MIN, 1, 3, str_1), dtostrf(PROBE_Y_MIN, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Popup_Handler(ManualProbing); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else { |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s\nG0 F300 Z%s"), dtostrf(corner_pos, 1, 3, str_1), dtostrf(corner_pos, 1, 3, str_2), dtostrf(mlev_z_pos, 1, 3, str_3)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1387,14 +1387,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (use_probe) { |
|
|
|
#if HAS_BED_PROBE |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s"), dtostrf(PROBE_X_MIN, 1, 3, str_1), dtostrf(PROBE_Y_MAX, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Popup_Handler(ManualProbing); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else { |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s\nG0 F300 Z%s"), dtostrf(corner_pos, 1, 3, str_1), dtostrf((Y_BED_SIZE + Y_MIN_POS) - corner_pos, 1, 3, str_2), dtostrf(mlev_z_pos, 1, 3, str_3)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1408,14 +1408,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (use_probe) { |
|
|
|
#if HAS_BED_PROBE |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s"), dtostrf(PROBE_X_MAX, 1, 3, str_1), dtostrf(PROBE_Y_MAX, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Popup_Handler(ManualProbing); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else { |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s\nG0 F300 Z%s"), dtostrf((X_BED_SIZE + X_MIN_POS) - corner_pos, 1, 3, str_1), dtostrf((Y_BED_SIZE + Y_MIN_POS) - corner_pos, 1, 3, str_2), dtostrf(mlev_z_pos, 1, 3, str_3)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1429,14 +1429,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (use_probe) { |
|
|
|
#if HAS_BED_PROBE |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s"), dtostrf(PROBE_X_MAX, 1, 3, str_1), dtostrf(PROBE_Y_MIN, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Popup_Handler(ManualProbing); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else { |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s\nG0 F300 Z%s"), dtostrf((X_BED_SIZE + X_MIN_POS) - corner_pos, 1, 3, str_1), dtostrf(corner_pos, 1, 3, str_2), dtostrf(mlev_z_pos, 1, 3, str_3)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1450,14 +1450,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (use_probe) { |
|
|
|
#if HAS_BED_PROBE |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s"), dtostrf(X_MAX_POS / 2.0f - probe.offset.x, 1, 3, str_1), dtostrf(Y_MAX_POS / 2.0f - probe.offset.y, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Popup_Handler(ManualProbing); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else { |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000\nG0 Z10\nG0 X%s Y%s\nG0 F300 Z%s"), dtostrf((X_BED_SIZE + X_MIN_POS) / 2.0f, 1, 3, str_1), dtostrf((Y_BED_SIZE + Y_MIN_POS) / 2.0f, 1, 3, str_2), dtostrf(mlev_z_pos, 1, 3, str_3)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1500,16 +1500,16 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_Homing, F("Home Z Axis")); |
|
|
|
else { |
|
|
|
Popup_Handler(Home); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G28 Z")); |
|
|
|
gcode.process_subcommands_now(F("G28 Z")); |
|
|
|
Popup_Handler(MoveWait); |
|
|
|
#if ENABLED(Z_SAFE_HOMING) |
|
|
|
planner.synchronize(); |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000 X%s Y%s"), dtostrf(Z_SAFE_HOMING_X_POINT, 1, 3, str_1), dtostrf(Z_SAFE_HOMING_Y_POINT, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
#else |
|
|
|
gcode.process_subcommands_now_P(PSTR("G0 F4000 X117.5 Y117.5")); |
|
|
|
gcode.process_subcommands_now(F("G0 F4000 X117.5 Y117.5")); |
|
|
|
#endif |
|
|
|
gcode.process_subcommands_now_P(PSTR("G0 F300 Z0")); |
|
|
|
gcode.process_subcommands_now(F("G0 F300 Z0")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1529,11 +1529,11 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
#if ENABLED(Z_SAFE_HOMING) |
|
|
|
planner.synchronize(); |
|
|
|
sprintf_P(cmd, PSTR("G0 F4000 X%s Y%s"), dtostrf(Z_SAFE_HOMING_X_POINT, 1, 3, str_1), dtostrf(Z_SAFE_HOMING_Y_POINT, 1, 3, str_2)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
#else |
|
|
|
gcode.process_subcommands_now_P(PSTR("G0 F4000 X117.5 Y117.5")); |
|
|
|
gcode.process_subcommands_now(F("G0 F4000 X117.5 Y117.5")); |
|
|
|
#endif |
|
|
|
gcode.process_subcommands_now_P(PSTR("G0 F300 Z0")); |
|
|
|
gcode.process_subcommands_now(F("G0 F300 Z0")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1555,7 +1555,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
else { |
|
|
|
if (zoffsetvalue < MAX_Z_OFFSET) { |
|
|
|
if (liveadjust) { |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
} |
|
|
|
zoffsetvalue += 0.01; |
|
|
@ -1569,7 +1569,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
else { |
|
|
|
if (zoffsetvalue > MIN_Z_OFFSET) { |
|
|
|
if (liveadjust) { |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z-0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
} |
|
|
|
zoffsetvalue -= 0.01; |
|
|
@ -1737,7 +1737,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
thermalManager.wait_for_hotend(0); |
|
|
|
} |
|
|
|
Popup_Handler(FilLoad); |
|
|
|
gcode.process_subcommands_now_P(PSTR("M701")); |
|
|
|
gcode.process_subcommands_now(F("M701")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1756,7 +1756,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
thermalManager.wait_for_hotend(0); |
|
|
|
} |
|
|
|
Popup_Handler(FilLoad, true); |
|
|
|
gcode.process_subcommands_now_P(PSTR("M702")); |
|
|
|
gcode.process_subcommands_now(F("M702")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -1775,7 +1775,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
} |
|
|
|
Popup_Handler(FilChange); |
|
|
|
sprintf_P(cmd, PSTR("M600 B1 R%i"), thermalManager.temp_hotend[0].target); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
@ -2032,7 +2032,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
else { |
|
|
|
Popup_Handler(PIDWait); |
|
|
|
sprintf_P(cmd, PSTR("M303 E0 C%i S%i U1"), PID_cycles, PID_e_temp); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -2099,7 +2099,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
else { |
|
|
|
Popup_Handler(PIDWait); |
|
|
|
sprintf_P(cmd, PSTR("M303 E-1 C%i S%i U1"), PID_cycles, PID_bed_temp); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -3045,7 +3045,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_StepY, F("M48 Probe Test")); |
|
|
|
else { |
|
|
|
sprintf_P(cmd, PSTR("G28O\nM48 X%s Y%s P%i"), dtostrf((X_BED_SIZE + X_MIN_POS) / 2.0f, 1, 3, str_1), dtostrf((Y_BED_SIZE + Y_MIN_POS) / 2.0f, 1, 3, str_2), testcount); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
} |
|
|
|
break; |
|
|
|
case PROBE_TEST_COUNT: |
|
|
@ -3157,11 +3157,12 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Popup_Handler(Home); |
|
|
|
gcode.home_all_axes(true); |
|
|
|
Popup_Handler(Level); |
|
|
|
if (mesh_conf.tilt_grid > 1) |
|
|
|
if (mesh_conf.tilt_grid > 1) { |
|
|
|
sprintf_P(cmd, PSTR("G29 J%i"), mesh_conf.tilt_grid); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
} |
|
|
|
else |
|
|
|
sprintf_P(cmd, PSTR("G29 J")); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(F("G29 J")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
@ -3189,8 +3190,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
#endif |
|
|
|
#if HAS_BED_PROBE |
|
|
|
Popup_Handler(Level); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 P0\nG29 P1")); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nM420 S1")); |
|
|
|
gcode.process_subcommands_now(F("G29 P0\nG29 P1")); |
|
|
|
gcode.process_subcommands_now(F("G29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nG29 P3\nM420 S1")); |
|
|
|
planner.synchronize(); |
|
|
|
Update_Status("Probed all reachable points"); |
|
|
|
Popup_Handler(SaveLevel); |
|
|
@ -3205,7 +3206,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
#endif |
|
|
|
#elif HAS_BED_PROBE |
|
|
|
Popup_Handler(Level); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29")); |
|
|
|
gcode.process_subcommands_now(F("G29")); |
|
|
|
planner.synchronize(); |
|
|
|
Popup_Handler(SaveLevel); |
|
|
|
#else |
|
|
@ -3213,7 +3214,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
set_bed_leveling_enabled(false); |
|
|
|
gridpoint = 1; |
|
|
|
Popup_Handler(MoveWait); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29")); |
|
|
|
gcode.process_subcommands_now(F("G29")); |
|
|
|
planner.synchronize(); |
|
|
|
Draw_Menu(ManualMesh); |
|
|
|
#endif |
|
|
@ -3296,7 +3297,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Popup_Handler(MeshSlot); |
|
|
|
break; |
|
|
|
} |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 L")); |
|
|
|
gcode.process_subcommands_now(F("G29 L")); |
|
|
|
planner.synchronize(); |
|
|
|
AudioFeedback(true); |
|
|
|
} |
|
|
@ -3309,7 +3310,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Popup_Handler(MeshSlot); |
|
|
|
break; |
|
|
|
} |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 S")); |
|
|
|
gcode.process_subcommands_now(F("G29 S")); |
|
|
|
planner.synchronize(); |
|
|
|
AudioFeedback(true); |
|
|
|
} |
|
|
@ -3405,7 +3406,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_ResumeEEPROM, F("Convert Mesh to Plane")); |
|
|
|
else { |
|
|
|
if (mesh_conf.create_plane_from_mesh()) break; |
|
|
|
gcode.process_subcommands_now_P(PSTR("M420 S1")); |
|
|
|
gcode.process_subcommands_now(F("M420 S1")); |
|
|
|
planner.synchronize(); |
|
|
|
AudioFeedback(true); |
|
|
|
} |
|
|
@ -3513,7 +3514,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); |
|
|
|
else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { |
|
|
|
Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z += 0.01f; |
|
|
|
sync_plan_position(); |
|
|
@ -3525,7 +3526,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_AxisD, F("Microstep Down")); |
|
|
|
else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { |
|
|
|
Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z-0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z -= 0.01f; |
|
|
|
sync_plan_position(); |
|
|
@ -3596,7 +3597,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
mesh_conf.manual_move(); |
|
|
|
} |
|
|
|
else { |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 S")); |
|
|
|
gcode.process_subcommands_now(F("G29 S")); |
|
|
|
planner.synchronize(); |
|
|
|
AudioFeedback(true); |
|
|
|
Draw_Menu(Leveling, LEVELING_GET_MESH); |
|
|
@ -3634,7 +3635,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); |
|
|
|
else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { |
|
|
|
Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z += 0.01f; |
|
|
|
sync_plan_position(); |
|
|
@ -3646,7 +3647,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
Draw_Menu_Item(row, ICON_Axis, F("Microstep Down")); |
|
|
|
else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { |
|
|
|
Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z-0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z -= 0.01f; |
|
|
|
sync_plan_position(); |
|
|
@ -3673,7 +3674,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (draw) |
|
|
|
Draw_Menu_Item(row, ICON_Back, F("Cancel")); |
|
|
|
else { |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 A")); |
|
|
|
gcode.process_subcommands_now(F("G29 A")); |
|
|
|
planner.synchronize(); |
|
|
|
set_bed_leveling_enabled(level_state); |
|
|
|
Draw_Menu(Leveling, LEVELING_GET_MESH); |
|
|
@ -3688,13 +3689,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
} |
|
|
|
else if (gridpoint < GRID_MAX_POINTS) { |
|
|
|
Popup_Handler(MoveWait); |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29")); |
|
|
|
gcode.process_subcommands_now(F("G29")); |
|
|
|
planner.synchronize(); |
|
|
|
gridpoint++; |
|
|
|
Redraw_Menu(); |
|
|
|
} |
|
|
|
else { |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29")); |
|
|
|
gcode.process_subcommands_now(F("G29")); |
|
|
|
planner.synchronize(); |
|
|
|
AudioFeedback(settings.save()); |
|
|
|
Draw_Menu(Leveling, LEVELING_GET_MESH); |
|
|
@ -3713,7 +3714,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (draw) |
|
|
|
Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); |
|
|
|
else if (current_position.z < MAX_Z_OFFSET) { |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z += 0.01f; |
|
|
|
sync_plan_position(); |
|
|
@ -3724,7 +3725,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (draw) |
|
|
|
Draw_Menu_Item(row, ICON_AxisD, F("Microstep Down")); |
|
|
|
else if (current_position.z > MIN_Z_OFFSET) { |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z-0.01")); |
|
|
|
planner.synchronize(); |
|
|
|
current_position.z -= 0.01f; |
|
|
|
sync_plan_position(); |
|
|
@ -3845,7 +3846,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (draw) |
|
|
|
Draw_Menu_Item(row, ICON_Axis, F("Z-Offset Up")); |
|
|
|
else if (zoffsetvalue < MAX_Z_OFFSET) { |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z0.01")); |
|
|
|
zoffsetvalue += 0.01; |
|
|
|
Draw_Float(zoffsetvalue, row - 1, false, 100); |
|
|
|
} |
|
|
@ -3854,7 +3855,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
if (draw) |
|
|
|
Draw_Menu_Item(row, ICON_AxisD, F("Z-Offset Down")); |
|
|
|
else if (zoffsetvalue > MIN_Z_OFFSET) { |
|
|
|
gcode.process_subcommands_now_P(PSTR("M290 Z-0.01")); |
|
|
|
gcode.process_subcommands_now(F("M290 Z-0.01")); |
|
|
|
zoffsetvalue -= 0.01; |
|
|
|
Draw_Float(zoffsetvalue, row - 2, false, 100); |
|
|
|
} |
|
|
@ -3932,27 +3933,27 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ |
|
|
|
case Prepare: |
|
|
|
Popup_Handler(FilChange); |
|
|
|
sprintf_P(cmd, PSTR("M600 B1 R%i"), thermalManager.temp_hotend[0].target); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
break; |
|
|
|
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) |
|
|
|
case ChangeFilament: |
|
|
|
switch (last_selection) { |
|
|
|
case CHANGEFIL_LOAD: |
|
|
|
Popup_Handler(FilLoad); |
|
|
|
gcode.process_subcommands_now_P("M701"); |
|
|
|
gcode.process_subcommands_now(F("M701")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(true, true, true); |
|
|
|
break; |
|
|
|
case CHANGEFIL_UNLOAD: |
|
|
|
Popup_Handler(FilLoad, true); |
|
|
|
gcode.process_subcommands_now_P("M702"); |
|
|
|
gcode.process_subcommands_now(F("M702")); |
|
|
|
planner.synchronize(); |
|
|
|
Redraw_Menu(true, true, true); |
|
|
|
break; |
|
|
|
case CHANGEFIL_CHANGE: |
|
|
|
Popup_Handler(FilChange); |
|
|
|
sprintf_P(cmd, PSTR("M600 B1 R%i"), thermalManager.temp_hotend[0].target); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
break; |
|
|
|
} |
|
|
|
break; |
|
|
@ -4291,7 +4292,7 @@ void CrealityDWINClass::Value_Control() { |
|
|
|
} |
|
|
|
else if (active_menu == Tune && selection == TUNE_ZOFFSET) { |
|
|
|
sprintf_P(cmd, PSTR("M290 Z%s"), dtostrf((tempvalue / valueunit - zoffsetvalue), 1, 3, str_1)); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
} |
|
|
|
if (TERN0(HAS_HOTEND, valuepointer == &thermalManager.temp_hotend[0].pid.Ki) || TERN0(HAS_HEATED_BED, valuepointer == &thermalManager.temp_bed.pid.Ki)) |
|
|
|
tempvalue = scalePID_i(tempvalue); |
|
|
@ -4490,11 +4491,11 @@ void CrealityDWINClass::Print_Screen_Control() { |
|
|
|
char cmnd[20]; |
|
|
|
#if HAS_HEATED_BED |
|
|
|
cmnd[sprintf_P(cmnd, PSTR("M140 S%i"), pausebed)] = '\0'; |
|
|
|
gcode.process_subcommands_now_P(PSTR(cmnd)); |
|
|
|
gcode.process_subcommands_now(cmnd); |
|
|
|
#endif |
|
|
|
#if HAS_EXTRUDERS |
|
|
|
cmnd[sprintf_P(cmnd, PSTR("M109 S%i"), pausetemp)] = '\0'; |
|
|
|
gcode.process_subcommands_now_P(PSTR(cmnd)); |
|
|
|
gcode.process_subcommands_now(cmnd); |
|
|
|
#endif |
|
|
|
TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan); |
|
|
|
planner.synchronize(); |
|
|
@ -4619,7 +4620,7 @@ void CrealityDWINClass::Popup_Control() { |
|
|
|
} |
|
|
|
Popup_Handler(FilChange); |
|
|
|
sprintf_P(cmd, PSTR("M600 B1 R%i"), thermalManager.temp_hotend[0].target); |
|
|
|
gcode.process_subcommands_now_P(cmd); |
|
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
@ -4642,7 +4643,7 @@ void CrealityDWINClass::Popup_Control() { |
|
|
|
case SaveLevel: |
|
|
|
if (selection == 0) { |
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
|
gcode.process_subcommands_now_P(PSTR("G29 S")); |
|
|
|
gcode.process_subcommands_now(F("G29 S")); |
|
|
|
planner.synchronize(); |
|
|
|
AudioFeedback(true); |
|
|
|
#else |
|
|
|