From 85c32a2bb628cd86b067ba5cf4c24bc5c05617d3 Mon Sep 17 00:00:00 2001 From: David Ramiro Date: Wed, 6 Mar 2019 22:59:46 +0100 Subject: [PATCH] Fix Z movement on abort - Referencing #29 - Adding audio feedback to special menu M500 and M502 --- Marlin/AnycubicTFT.cpp | 45 ++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/Marlin/AnycubicTFT.cpp b/Marlin/AnycubicTFT.cpp index 61dab2d..ac37ffb 100644 --- a/Marlin/AnycubicTFT.cpp +++ b/Marlin/AnycubicTFT.cpp @@ -222,37 +222,30 @@ void AnycubicTFTClass::PausePrint(){ } void AnycubicTFTClass::StopPrint(){ + #ifdef SDSUPPORT card.stopSDPrint(); #endif clear_command_queue(); - if((current_position[Z_AXIS]<150)) - { - enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z20 F240")); - enqueue_and_echo_commands_P(PSTR("G90")); - } - else if ((current_position[Z_AXIS]<190)) - { - enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z10 F240")); - enqueue_and_echo_commands_P(PSTR("G90")); - } - else if ((current_position[Z_AXIS]<200)) - { - enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z5 F240")); - enqueue_and_echo_commands_P(PSTR("G90")); - } - else if ((current_position[Z_AXIS]>=200)) - { - enqueue_and_echo_commands_P(PSTR("G91")); - enqueue_and_echo_commands_P(PSTR("G1 Z1 F240")); - enqueue_and_echo_commands_P(PSTR("G90")); - } quickstop_stepper(); print_job_timer.stop(); thermalManager.disable_all_heaters(); + if((current_position[Z_AXIS]<150)) + { + enqueue_and_echo_commands_P(PSTR("G91\nG1 Z20 F240\nG90")); + } + else if ((current_position[Z_AXIS]<190)) + { + enqueue_and_echo_commands_P(PSTR("G91\nG1 Z10 F240\nG90")); + } + else if ((current_position[Z_AXIS]<200)) + { + enqueue_and_echo_commands_P(PSTR("G91\nG1 Z5 F240\nG90")); + } + else if ((current_position[Z_AXIS]>=200)) + { + enqueue_and_echo_commands_P(PSTR("G91\nG1 Z1 F240\G90")); + } #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; #endif @@ -303,10 +296,10 @@ void AnycubicTFTClass::HandleSpecialMenu() enqueue_and_echo_commands_P(PSTR("M303 E-1 S60 C6 U1")); } else if (strcmp(SelectedDirectory, "")==0) { SERIAL_PROTOCOLLNPGM("Special Menu: Save EEPROM"); - enqueue_and_echo_commands_P(PSTR("M500")); + enqueue_and_echo_commands_P(PSTR("M500\nM300 S1108 P105\nM300 S1661 P210")); } else if (strcmp(SelectedDirectory, "")==0) { SERIAL_PROTOCOLLNPGM("Special Menu: Load FW Defaults"); - enqueue_and_echo_commands_P(PSTR("M502")); + enqueue_and_echo_commands_P(PSTR("M502\nM300 S1661 P105\nM300 S1108 P210")); } else if (strcmp(SelectedDirectory, "")==0) { SERIAL_PROTOCOLLNPGM("Special Menu: Preheat Bed"); enqueue_and_echo_commands_P(PSTR("M140 S60"));