Skip to content

Commit

Permalink
Merge pull request MarlinFirmware#41 from makerbase-mks/master
Browse files Browse the repository at this point in the history
LS
  • Loading branch information
Chlorel authored Mar 6, 2021
2 parents 6104d6c + 496892b commit e161e35
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3348,6 +3348,7 @@
*/
#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define CUSTOM_RETURN_READY_PRINT
//#define CUSTOM_USER_MENU_TITLE "Custom Commands"
//#define USER_SCRIPT_DONE "M117 User Script Done"
//#define USER_SCRIPT_AUDIBLE_FEEDBACK
Expand Down
21 changes: 14 additions & 7 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
if (event != LV_EVENT_RELEASED) return;
switch (obj->mks_obj_id) {
#if ENABLED(USER_CMD_1_ENABLE)
case ID_CUSTOM_1: queue.inject_P(PSTR(USER_GCODE_1)); break;
case ID_CUSTOM_1: queue.inject_P(PSTR(USER_GCODE_1)); lv_return_to_ready(); break;
#endif
#if ENABLED(USER_CMD_2_ENABLE)
case ID_CUSTOM_2: queue.inject_P(PSTR(USER_GCODE_2)); break;
case ID_CUSTOM_2: queue.inject_P(PSTR(USER_GCODE_2)); lv_return_to_ready(); break;
#endif
#if ENABLED(USER_CMD_3_ENABLE)
case ID_CUSTOM_3: queue.inject_P(PSTR(USER_GCODE_3)); break;
case ID_CUSTOM_3: queue.inject_P(PSTR(USER_GCODE_3)); lv_return_to_ready(); break;
#endif
#if ENABLED(USER_CMD_4_ENABLE)
case ID_CUSTOM_4: queue.inject_P(PSTR(USER_GCODE_4)); break;
case ID_CUSTOM_4: queue.inject_P(PSTR(USER_GCODE_4)); lv_return_to_ready(); break;
#endif
#if ENABLED(USER_CMD_5_ENABLE)
case ID_CUSTOM_5: queue.inject_P(PSTR(USER_GCODE_5)); break;
case ID_CUSTOM_5: queue.inject_P(PSTR(USER_GCODE_5)); lv_return_to_ready(); break;
#endif
#if ENABLED(USER_CMD_6_ENABLE)
case ID_CUSTOM_6: queue.inject_P(PSTR(USER_GCODE_6)); break;
case ID_CUSTOM_6: queue.inject_P(PSTR(USER_GCODE_6)); lv_return_to_ready(); break;
#endif
#if ENABLED(USER_CMD_7_ENABLE)
case ID_CUSTOM_7: queue.inject_P(PSTR(USER_GCODE_7)); break;
case ID_CUSTOM_7: queue.inject_P(PSTR(USER_GCODE_7)); lv_return_to_ready(); break;
#endif
case ID_M_RETURN:
lv_clear_more();
Expand All @@ -74,6 +74,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
}
}

void lv_return_to_ready (void) {
#ifdef CUSTOM_RETURN_READY_PRINT
lv_clear_more();
lv_draw_ready_print();
#endif
}

void lv_draw_more(void) {
scr = lv_screen_create(MORE_UI);

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_more.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
extern "C" { /* C-declarations for C++ */
#endif

extern void lv_return_to_ready (void);
extern void lv_draw_more(void);
extern void lv_clear_more();

Expand Down

0 comments on commit e161e35

Please sign in to comment.