Fix Z movement on abort

- Referencing #29
- Adding audio feedback to special menu M500 and M502
This commit is contained in:
David Ramiro 2019-03-06 22:59:46 +01:00
parent 2c53c33d52
commit 85c32a2bb6
No known key found for this signature in database
GPG Key ID: 5B042737EBEEB736
1 changed files with 19 additions and 26 deletions

View File

@ -222,37 +222,30 @@ void AnycubicTFTClass::PausePrint(){
} }
void AnycubicTFTClass::StopPrint(){ void AnycubicTFTClass::StopPrint(){
#ifdef SDSUPPORT #ifdef SDSUPPORT
card.stopSDPrint(); card.stopSDPrint();
#endif #endif
clear_command_queue(); 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(); quickstop_stepper();
print_job_timer.stop(); print_job_timer.stop();
thermalManager.disable_all_heaters(); 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 #if FAN_COUNT > 0
for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
#endif #endif
@ -303,10 +296,10 @@ void AnycubicTFTClass::HandleSpecialMenu()
enqueue_and_echo_commands_P(PSTR("M303 E-1 S60 C6 U1")); enqueue_and_echo_commands_P(PSTR("M303 E-1 S60 C6 U1"));
} else if (strcmp(SelectedDirectory, "<save eeprom>")==0) { } else if (strcmp(SelectedDirectory, "<save eeprom>")==0) {
SERIAL_PROTOCOLLNPGM("Special Menu: Save EEPROM"); 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, "<load fw defaults>")==0) { } else if (strcmp(SelectedDirectory, "<load fw defaults>")==0) {
SERIAL_PROTOCOLLNPGM("Special Menu: Load FW Defaults"); 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, "<preheat bed>")==0) { } else if (strcmp(SelectedDirectory, "<preheat bed>")==0) {
SERIAL_PROTOCOLLNPGM("Special Menu: Preheat Bed"); SERIAL_PROTOCOLLNPGM("Special Menu: Preheat Bed");
enqueue_and_echo_commands_P(PSTR("M140 S60")); enqueue_and_echo_commands_P(PSTR("M140 S60"));