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

Add example configs. Expand custom menu. #16286

Merged
merged 3 commits into from
Jan 4, 2020
Merged
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
82 changes: 72 additions & 10 deletions Marlin/src/lcd/menu/menu_custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,82 @@ void _lcd_user_gcode(PGM_P const cmd) {
void menu_user() {
START_MENU();
BACK_ITEM(MSG_MAIN);
#if defined(USER_DESC_1) && defined(USER_GCODE_1)
ACTION_ITEM_P(PSTR(USER_DESC_1), []{ _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); });
#define HAS_USER_ITEM(N) (defined(USER_DESC_##N) && defined(USER_GCODE_##N))
#define USER_ITEM(N) ACTION_ITEM_P(PSTR(USER_DESC_##N), []{ _lcd_user_gcode(PSTR(USER_GCODE_##N _DONE_SCRIPT)); });
#if HAS_USER_ITEM(1)
USER_ITEM(1);
#endif
#if defined(USER_DESC_2) && defined(USER_GCODE_2)
ACTION_ITEM_P(PSTR(USER_DESC_2), []{ _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); });
#if HAS_USER_ITEM(2)
USER_ITEM(2);
#endif
#if defined(USER_DESC_3) && defined(USER_GCODE_3)
ACTION_ITEM_P(PSTR(USER_DESC_3), []{ _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); });
#if HAS_USER_ITEM(3)
USER_ITEM(3);
#endif
#if defined(USER_DESC_4) && defined(USER_GCODE_4)
ACTION_ITEM_P(PSTR(USER_DESC_4), []{ _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); });
#if HAS_USER_ITEM(4)
USER_ITEM(4);
#endif
#if defined(USER_DESC_5) && defined(USER_GCODE_5)
ACTION_ITEM_P(PSTR(USER_DESC_5), []{ _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); });
#if HAS_USER_ITEM(5)
USER_ITEM(5);
#endif
#if HAS_USER_ITEM(6)
USER_ITEM(6);
#endif
#if HAS_USER_ITEM(7)
USER_ITEM(7);
#endif
#if HAS_USER_ITEM(8)
USER_ITEM(8);
#endif
#if HAS_USER_ITEM(9)
USER_ITEM(9);
#endif
#if HAS_USER_ITEM(10)
USER_ITEM(10);
#endif
#if HAS_USER_ITEM(11)
USER_ITEM(11);
#endif
#if HAS_USER_ITEM(12)
USER_ITEM(12);
#endif
#if HAS_USER_ITEM(13)
USER_ITEM(13);
#endif
#if HAS_USER_ITEM(14)
USER_ITEM(14);
#endif
#if HAS_USER_ITEM(15)
USER_ITEM(15);
#endif
#if HAS_USER_ITEM(16)
USER_ITEM(16);
#endif
#if HAS_USER_ITEM(17)
USER_ITEM(17);
#endif
#if HAS_USER_ITEM(18)
USER_ITEM(18);
#endif
#if HAS_USER_ITEM(19)
USER_ITEM(19);
#endif
#if HAS_USER_ITEM(20)
USER_ITEM(20);
#endif
#if HAS_USER_ITEM(21)
USER_ITEM(21);
#endif
#if HAS_USER_ITEM(22)
USER_ITEM(22);
#endif
#if HAS_USER_ITEM(23)
USER_ITEM(23);
#endif
#if HAS_USER_ITEM(24)
USER_ITEM(24);
#endif
#if HAS_USER_ITEM(25)
USER_ITEM(25);
#endif
END_MENU();
}
Expand Down
Loading