|
@@ -3573,101 +3573,86 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
|
|
else
|
|
|
unload_filament(true);
|
|
|
st_synchronize();
|
|
|
-
|
|
|
-#ifdef FILAMENT_SENSOR
|
|
|
- fsensor.setRunoutEnabled(false);
|
|
|
- fsensor.setAutoLoadEnabled(false);
|
|
|
-#if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125)
|
|
|
- fsensor.setJamDetectionEnabled(false);
|
|
|
-#endif
|
|
|
-#endif
|
|
|
-
|
|
|
- if (!MMU2::mmu2.Enabled()) {
|
|
|
- KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
- lcd_change_fil_state =
|
|
|
- lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Was filament unload successful?"), false, LCD_LEFT_BUTTON_CHOICE);
|
|
|
- if (lcd_change_fil_state == LCD_MIDDLE_BUTTON_CHOICE) {
|
|
|
- lcd_clear();
|
|
|
- lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
- current_position[X_AXIS] -= 100;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
|
|
- st_synchronize();
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (MMU2::mmu2.Enabled()) {
|
|
|
- if (!automatic) {
|
|
|
- if (saved_printing){
|
|
|
-
|
|
|
- MMU2::mmu2.eject_filament(MMU2::mmu2.get_current_tool(), false);
|
|
|
- }
|
|
|
- mmu_M600_wait_and_beep();
|
|
|
- if (saved_printing) {
|
|
|
+ {
|
|
|
+ FSensorBlockRunout fsBlockRunout;
|
|
|
+
|
|
|
+ if (!MMU2::mmu2.Enabled()) {
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
+ lcd_change_fil_state =
|
|
|
+ lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Was filament unload successful?"), false, LCD_LEFT_BUTTON_CHOICE);
|
|
|
+ if (lcd_change_fil_state == LCD_MIDDLE_BUTTON_CHOICE) {
|
|
|
lcd_clear();
|
|
|
lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
+ current_position[X_AXIS] -= 100;
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
|
|
+ st_synchronize();
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (MMU2::mmu2.Enabled()) {
|
|
|
+ if (!automatic) {
|
|
|
+ if (saved_printing){
|
|
|
+
|
|
|
+ MMU2::mmu2.eject_filament(MMU2::mmu2.get_current_tool(), false);
|
|
|
+ }
|
|
|
+ mmu_M600_wait_and_beep();
|
|
|
+ if (saved_printing) {
|
|
|
+ lcd_clear();
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+ mmu_M600_load_filament(automatic, HotendTempBckp);
|
|
|
+ } else
|
|
|
+ M600_load_filament();
|
|
|
+
|
|
|
+ if (!automatic)
|
|
|
+ M600_check_state(HotendTempBckp);
|
|
|
+
|
|
|
+ lcd_update_enable(true);
|
|
|
+
|
|
|
+
|
|
|
+ fanSpeed = fanSpeedBckp;
|
|
|
+
|
|
|
+
|
|
|
+ if (!automatic) {
|
|
|
+ current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED);
|
|
|
}
|
|
|
- mmu_M600_load_filament(automatic, HotendTempBckp);
|
|
|
- } else
|
|
|
- M600_load_filament();
|
|
|
-
|
|
|
- if (!automatic)
|
|
|
- M600_check_state(HotendTempBckp);
|
|
|
-
|
|
|
- lcd_update_enable(true);
|
|
|
-
|
|
|
-
|
|
|
- fanSpeed = fanSpeedBckp;
|
|
|
-
|
|
|
-
|
|
|
- if (!automatic) {
|
|
|
- current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED);
|
|
|
+
|
|
|
+
|
|
|
+ plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+
|
|
|
+ plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+
|
|
|
+
|
|
|
+ plan_set_e_position(lastpos[E_AXIS]);
|
|
|
+
|
|
|
+ memcpy(current_position, lastpos, sizeof(lastpos));
|
|
|
+ set_destination_to_current();
|
|
|
+
|
|
|
+
|
|
|
+ feedmultiply = feedmultiplyBckp;
|
|
|
+ char cmd[9];
|
|
|
+ sprintf_P(cmd, PSTR("M220 S%i"), feedmultiplyBckp);
|
|
|
+ enquecommand(cmd);
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder);
|
|
|
- st_synchronize();
|
|
|
-
|
|
|
- plan_buffer_line(lastpos[X_AXIS], lastpos[Y_AXIS], lastpos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED, active_extruder);
|
|
|
- st_synchronize();
|
|
|
-
|
|
|
-
|
|
|
- plan_set_e_position(lastpos[E_AXIS]);
|
|
|
-
|
|
|
- memcpy(current_position, lastpos, sizeof(lastpos));
|
|
|
- set_destination_to_current();
|
|
|
-
|
|
|
-
|
|
|
- feedmultiply = feedmultiplyBckp;
|
|
|
- char cmd[9];
|
|
|
- sprintf_P(cmd, PSTR("M220 S%i"), feedmultiplyBckp);
|
|
|
- enquecommand(cmd);
|
|
|
-
|
|
|
-#ifdef FILAMENT_SENSOR
|
|
|
- fsensor.settings_init();
|
|
|
-#endif
|
|
|
-
|
|
|
+
|
|
|
lcd_setstatuspgm(MSG_WELCOME);
|
|
|
custom_message_type = CustomMsg::Status;
|
|
|
}
|
|
|
|
|
|
void gcode_M701(uint8_t mmuSlotIndex){
|
|
|
printf_P(PSTR("gcode_M701 begin\n"));
|
|
|
-
|
|
|
-#ifdef FILAMENT_SENSOR
|
|
|
- fsensor.setRunoutEnabled(false);
|
|
|
- fsensor.setAutoLoadEnabled(false);
|
|
|
-#if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125)
|
|
|
- fsensor.setJamDetectionEnabled(false);
|
|
|
-#endif
|
|
|
-#endif
|
|
|
-
|
|
|
- prusa_statistics(22);
|
|
|
- }
|
|
|
+
|
|
|
+ FSensorBlockRunout fsBlockRunout;
|
|
|
+
|
|
|
+ prusa_statistics(22);
|
|
|
|
|
|
if (MMU2::mmu2.Enabled() && mmuSlotIndex < MMU_FILAMENT_COUNT) {
|
|
|
MMU2::mmu2.load_filament(mmuSlotIndex);
|
|
@@ -3705,10 +3690,6 @@ void gcode_M701(uint8_t mmuSlotIndex){
|
|
|
}
|
|
|
|
|
|
eFilamentAction = FilamentAction::None;
|
|
|
-
|
|
|
-#ifdef FILAMENT_SENSOR
|
|
|
- fsensor.settings_init();
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
* @brief Get serial number from 32U2 processor
|