Merge pull request #1088 from PavelSindler/M600_change_extruder

M600 change extruder
This commit is contained in:
PavelSindler 2018-08-29 14:43:02 +02:00 committed by GitHub
commit ef289bf9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 18 deletions

View File

@ -3121,16 +3121,18 @@ void gcode_M600(bool automatic, float x_position, float y_position, float z_shif
if (mmu_enabled) if (mmu_enabled)
{ {
if (saved_printing) mmu_eject_filament(mmu_extruder, false); //if M600 was invoked by filament senzor (FINDA) eject filament so user can easily remove it if (!automatic) {
if (!automatic) mmu_M600_wait_and_beep(); if (saved_printing) mmu_eject_filament(mmu_extruder, false); //if M600 was invoked by filament senzor (FINDA) eject filament so user can easily remove it
if (saved_printing) { mmu_M600_wait_and_beep();
if (saved_printing) {
lcd_clear(); lcd_clear();
lcd_set_cursor(0, 2); lcd_set_cursor(0, 2);
lcd_puts_P(_T(MSG_PLEASE_WAIT)); lcd_puts_P(_T(MSG_PLEASE_WAIT));
mmu_command(MMU_CMD_R0); mmu_command(MMU_CMD_R0);
manage_response(false, false); manage_response(false, false);
}
} }
mmu_M600_load_filament(automatic); mmu_M600_load_filament(automatic);
} }

View File

@ -814,11 +814,6 @@ void mmu_eject_fil_4()
mmu_eject_filament(4, true); mmu_eject_filament(4, true);
} }
void mmu_eject_fil_5()
{
mmu_eject_filament(5, true);
}
void load_all() void load_all()
{ {
#ifndef SNMM #ifndef SNMM
@ -954,13 +949,37 @@ void mmu_eject_filament(uint8_t filament, bool recover)
{ {
if (filament < 5) if (filament < 5)
{ {
mmu_command(MMU_CMD_E0 + filament);
manage_response(false, false); if (degHotend0() > EXTRUDE_MINTEMP)
if (recover)
{ {
lcd_show_fullscreen_message_and_wait_P(_i("Please remove filament and then press the knob.")); st_synchronize();
mmu_command(MMU_CMD_R0); lcd_update_enable(false);
lcd_clear();
lcd_set_cursor(0, 1); lcd_puts_P(_i("Ejecting filament"));
current_position[E_AXIS] -= 80;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
st_synchronize();
lcd_update_enable(true);
mmu_command(MMU_CMD_E0 + filament);
manage_response(false, false); manage_response(false, false);
if (recover)
{
lcd_show_fullscreen_message_and_wait_P(_i("Please remove filament and then press the knob."));
mmu_command(MMU_CMD_R0);
manage_response(false, false);
}
}
else
{
lcd_clear();
lcd_set_cursor(0, 0);
lcd_puts_P(_T(MSG_ERROR));
lcd_set_cursor(0, 2);
lcd_puts_P(_T(MSG_PREHEAT_NOZZLE));
delay(2000);
lcd_clear();
} }
} }
else else