Browse Source

Add "End Repeat Loops" menu item

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
f0c29afe21
  1. 4
      Marlin/src/feature/repeat.h
  2. 1
      Marlin/src/lcd/language/language_en.h
  3. 9
      Marlin/src/lcd/menu/menu_main.cpp

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

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

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

Loading…
Cancel
Save