My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

repeat.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "../inc/MarlinConfigPre.h"
  24. #include "../gcode/parser.h"
  25. #include <stdint.h>
  26. #define MAX_REPEAT_NESTING 10
  27. typedef struct {
  28. uint32_t sdpos; // The repeat file position
  29. int16_t counter; // The counter for looping
  30. } repeat_marker_t;
  31. class Repeat {
  32. private:
  33. static repeat_marker_t marker[MAX_REPEAT_NESTING];
  34. static uint8_t index;
  35. public:
  36. static inline void reset() { index = 0; }
  37. static bool is_command_M808(char * const cmd) { return cmd[0] == 'M' && cmd[1] == '8' && cmd[2] == '0' && cmd[3] == '8' && !NUMERIC(cmd[4]); }
  38. static void early_parse_M808(char * const cmd);
  39. static void add_marker(const uint32_t sdpos, const uint16_t count);
  40. static void loop();
  41. static void cancel();
  42. };
  43. extern Repeat repeat;