Optimize some G-code strings

This commit is contained in:
Scott Lahteine
2021-01-16 20:43:24 -06:00
parent e351ea2ee8
commit aabd40a7a2
11 changed files with 42 additions and 88 deletions

View File

@@ -620,10 +620,10 @@ namespace Anycubic {
case 21: // A21 Home Axis A21 X
if (!isPrinting()) {
switch ((char)panel_command[4]) {
case 'X': injectCommands_P(PSTR("G28 X")); break;
case 'Y': injectCommands_P(PSTR("G28 Y")); break;
case 'Z': injectCommands_P(PSTR("G28 Z")); break;
case 'C': injectCommands_P(PSTR("G28")); break;
case 'X': injectCommands_P(PSTR("G28X")); break;
case 'Y': injectCommands_P(PSTR("G28Y")); break;
case 'Z': injectCommands_P(PSTR("G28Z")); break;
case 'C': injectCommands_P(G28_STR); break;
}
}
break;
@@ -718,7 +718,7 @@ namespace Anycubic {
// If the same meshpoint is selected twice in a row, move the head to that ready for adjustment
if ((selectedmeshpoint.x == pos.x) && (selectedmeshpoint.y == pos.y)) {
if (!isPositionKnown())
injectCommands_P(PSTR("G28")); // home
injectCommands_P(G28_STR); // home
if (isPositionKnown()) {
#if ACDEBUG(AC_INFO)
@@ -746,7 +746,7 @@ namespace Anycubic {
if (isPrinting())
SendtoTFTLN(AC_msg_probing_not_allowed); // forbid auto leveling
else {
injectCommands_P(isMachineHomed() ? PSTR("G29") : PSTR("G28\nG29"));
injectCommands_P(PSTR("G28O\nG29"));
printer_state = AC_printer_probing;
SendtoTFTLN(AC_msg_start_probing);
}

View File

@@ -105,8 +105,8 @@
#define AC_cmnd_manual_load_filament PSTR("M83\nG1 E50 F700\nM82") // replace the manual panel commands with something a little faster
#define AC_cmnd_manual_unload_filament PSTR("M83\nG1 E-50 F1200\nM82")
#define AC_cmnd_enable_leveling PSTR("M420 S1 V1")
#define AC_cmnd_power_loss_recovery PSTR("G28 X Y R5\nG28 Z") // Lift, home X and Y then home Z when in 'safe' position
#define AC_cmnd_enable_leveling PSTR("M420SV")
#define AC_cmnd_power_loss_recovery PSTR("G28XYR5\nG28Z") // Lift, home X and Y then home Z when in 'safe' position
namespace Anycubic {
enum heater_state_t : uint8_t {