Skip to content

Commit

Permalink
🚸 Filament Change add confirm step (MarlinFirmware#22277)
Browse files Browse the repository at this point in the history
  • Loading branch information
cytown authored and ptoal committed Dec 16, 2021
1 parent 8272ce6 commit b2eb534
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
17 changes: 13 additions & 4 deletions Marlin/src/lcd/menu/menu_filament.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
* "Change Filament" submenu
*/
#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)

bool printingIsPaused();
#endif

void menu_change_filament() {
void menu_change_filament() {
#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
// Say "filament change" when no print is active
editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT;

Expand Down Expand Up @@ -204,8 +205,16 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
#endif

END_MENU();
}
#endif

#else

if (thermalManager.targetHotEnoughToExtrude(active_extruder))
queue.inject_P(PSTR("M600B0"));
else
_menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0);

#endif
}

static uint8_t hotend_status_extruder = 0;

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void menu_configuration();
#endif

#if ENABLED(ADVANCED_PAUSE_FEATURE)
void _menu_temp_filament_op(const PauseMode, const int8_t);
void menu_change_filament();
#endif

Expand Down Expand Up @@ -365,10 +364,11 @@ void menu_main() {

#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
GCODES_ITEM(MSG_FILAMENTCHANGE, PSTR("M600 B0"));
else
SUBMENU(MSG_FILAMENTCHANGE, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
CONFIRM_ITEM(MSG_FILAMENTCHANGE,
MSG_YES, MSG_NO,
menu_change_filament, ui.goto_previous_screen,
GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?")
);
#else
SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
#endif
Expand Down

0 comments on commit b2eb534

Please sign in to comment.