Add "End Repeat Loops" menu item

This commit is contained in:
Scott Lahteine 2020-12-23 20:22:58 -06:00
parent 4d6b6bcffc
commit f0c29afe21
3 changed files with 14 additions and 0 deletions

View File

@ -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);

View File

@ -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 =");

View File

@ -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)