diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h index e293b2bba..0f4d9425b 100644 --- a/Marlin/src/feature/repeat.h +++ b/Marlin/src/feature/repeat.h @@ -39,6 +39,10 @@ private: static uint8_t index; public: static inline void reset() { index = 0; } + static inline bool is_active() { + LOOP_L_N(i, index) if (marker[i].counter) return true; + return false; + } static bool is_command_M808(char * const cmd) { return cmd[0] == 'M' && cmd[1] == '8' && cmd[2] == '0' && cmd[3] == '8' && !NUMERIC(cmd[4]); } static void early_parse_M808(char * const cmd); static void add_marker(const uint32_t sdpos, const uint16_t count); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 194a75c6a..25460ed45 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -388,6 +388,7 @@ namespace Language_en { PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resume Print"); PROGMEM Language_Str MSG_HOST_START_PRINT = _UxGT("Host Start"); PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop Print"); + PROGMEM Language_Str MSG_END_LOOPS = _UxGT("End Repeat Loops"); PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Printing Object"); PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancel Object"); PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancel Object ="); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 968de3d4b..b7cd549e6 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -58,6 +58,10 @@ #include "../../feature/host_actions.h" #endif +#if ENABLED(GCODE_REPEAT_MARKERS) + #include "../../feature/repeat.h" +#endif + void menu_tune(); void menu_cancelobject(); void menu_motion(); @@ -120,6 +124,11 @@ void menu_main() { }); #endif + #if ENABLED(GCODE_REPEAT_MARKERS) + if (repeat.is_active()) + ACTION_ITEM(MSG_END_LOOPS, repeat.cancel); + #endif + SUBMENU(MSG_TUNE, menu_tune); #if ENABLED(CANCEL_OBJECTS) && DISABLED(SLIM_LCD_MENUS)