Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leave user's MMU-loaded filament loaded after first layer cal #4212

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Firmware/first_lay_cal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void lay1cal_wait_preheat()
//! @brief Load filament
//! @param cmd_buffer character buffer needed to format gcodes
//! @param filament filament to use (applies for MMU only)
//! @returns true if extra purge distance is needed in case of MMU prints (after a toolchange), otherwise false
//! @returns true if filament has been changed (therefore an extra purge distance is needed in case of MMU prints), otherwise false
bool lay1cal_load_filament(uint8_t filament)
{
if (MMU2::mmu2.Enabled())
Expand Down Expand Up @@ -225,7 +225,7 @@ void lay1cal_square(uint8_t step, float layer_height, float extrusion_width)
}
}

void lay1cal_finish(bool mmu_enabled)
void lay1cal_finish(bool unload_filament)
{
static const char cmd_cal_finish_1[] PROGMEM = "G1 E-0.075 F2100"; //retract
static const char cmd_cal_finish_2[] PROGMEM = "M104 S0"; // turn off temperature
Expand All @@ -245,6 +245,6 @@ void lay1cal_finish(bool mmu_enabled)

lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0])));

if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle
if (unload_filament) enquecommand_P(MSG_M702); //unload from nozzle
enquecommand_P(MSG_M84);// disable motors
}
2 changes: 1 addition & 1 deletion Firmware/first_lay_cal.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ void lay1cal_before_meander();
void lay1cal_meander_start(float layer_height, float extrusion_width);
void lay1cal_meander(float layer_height, float extrusion_width);
void lay1cal_square(uint8_t step, float layer_height, float extrusion_width);
void lay1cal_finish(bool mmu_enabled);
void lay1cal_finish(bool unload_filament);

#endif /* FIRMWARE_FIRST_LAY_CAL_H_ */
8 changes: 4 additions & 4 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int8_t SilentModeMenu = SILENT_MODE_OFF;

LcdCommands lcd_commands_type = LcdCommands::Idle;
static uint8_t lcd_commands_step = 0;
static bool extraPurgeNeeded = false; ///< lcd_commands - detect if extra purge after MMU-toolchange is necessary or not
static bool filament_changed = false; ///< lcd_commands - detect if extra purge after MMU-toolchange is necessary or not

CustomMsg custom_message_type = CustomMsg::Status;
uint8_t custom_message_state = 0;
Expand Down Expand Up @@ -807,13 +807,13 @@ void lcd_commands()
lay1cal_wait_preheat();
break;
case 11:
extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament);
filament_changed = lay1cal_load_filament(lay1cal_filament);
break;
case 10:
lcd_clear();
menu_depth = 0;
menu_submenu(lcd_babystep_z, true);
lay1cal_intro_line(extraPurgeNeeded, layer_height, extrusion_width);
lay1cal_intro_line(filament_changed, layer_height, extrusion_width);
break;
case 9:
lay1cal_before_meander();
Expand All @@ -837,7 +837,7 @@ void lcd_commands()
lay1cal_square(12, layer_height, extrusion_width);
break;
case 2:
lay1cal_finish(MMU2::mmu2.Enabled());
lay1cal_finish(MMU2::mmu2.Enabled() && filament_changed);
break;
case 1:
lcd_setstatuspgm(MSG_WELCOME);
Expand Down