Skip to content

Commit

Permalink
misc. cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 27, 2022
1 parent 5aa2ee4 commit 60c119b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
4 changes: 0 additions & 4 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3769,10 +3769,6 @@
#define HAS_ROTARY_ENCODER 1
#endif

#if DISABLED(DISABLE_ENCODER)
#define HAS_BACK_ITEM 1
#endif

#if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
#define HAS_DRIVER_SAFE_POWER_PROTECT 1
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class MenuItem_bool : public MenuEditItemBase {

// Predefined menu item types //

#if HAS_BACK_ITEM
#if DISABLED(DISABLE_ENCODER)
#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL)
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
#else
Expand Down
33 changes: 14 additions & 19 deletions Marlin/src/lcd/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,16 @@ void menu_configuration();

#endif // CUSTOM_MENU_MAIN

#if ENABLED(ADVANCED_PAUSE_FEATURE)
// This menu item is last with an encoder. Otherwise, somewhere in the middle.
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
#define FILAMENT_CHANGE_ITEM() YESNO_ITEM(MSG_FILAMENTCHANGE, menu_change_filament, nullptr, \
GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?"))
#else
#define FILAMENT_CHANGE_ITEM() SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament)
#endif
#endif

void menu_main() {
const bool busy = printingIsActive()
#if ENABLED(SDSUPPORT)
Expand Down Expand Up @@ -317,15 +327,8 @@ void menu_main() {
SUBMENU(MSG_MOTION, menu_motion);
}

#if ENABLED(DISABLE_ENCODER) && ENABLED(ADVANCED_PAUSE_FEATURE)
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
YESNO_ITEM(MSG_FILAMENTCHANGE,
menu_change_filament, nullptr,
GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")
);
#else
SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
#endif
#if BOTH(ADVANCED_PAUSE_FEATURE, DISABLE_ENCODER)
FILAMENT_CHANGE_ITEM();
#endif

#if HAS_CUTTER
Expand All @@ -336,7 +339,6 @@ void menu_main() {
SUBMENU(MSG_TEMPERATURE, menu_temperature);
#endif


#if HAS_POWER_MONITOR
SUBMENU(MSG_POWER_MONITOR, menu_power_monitor);
#endif
Expand Down Expand Up @@ -459,15 +461,8 @@ void menu_main() {
});
#endif

#if DISABLED(DISABLE_ENCODER) && ENABLED(ADVANCED_PAUSE_FEATURE)
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
YESNO_ITEM(MSG_FILAMENTCHANGE,
menu_change_filament, nullptr,
GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")
);
#else
SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) && DISABLED(DISABLE_ENCODER)
FILAMENT_CHANGE_ITEM();
#endif

END_MENU();
Expand Down

0 comments on commit 60c119b

Please sign in to comment.