My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MarlinCore.h 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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/MarlinConfig.h"
  24. #ifdef DEBUG_GCODE_PARSER
  25. #include "gcode/parser.h"
  26. #endif
  27. #include <math.h>
  28. #include <stdio.h>
  29. #include <stdlib.h>
  30. void stop();
  31. // Pass true to keep steppers from timing out
  32. void idle(bool no_stepper_sleep=false);
  33. inline void idle_no_sleep() { idle(true); }
  34. #if ENABLED(G38_PROBE_TARGET)
  35. extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
  36. extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
  37. #endif
  38. /**
  39. * The axis order in all axis related arrays is X, Y, Z, E
  40. */
  41. void enable_e_steppers();
  42. void enable_all_steppers();
  43. void disable_e_stepper(const uint8_t e);
  44. void disable_e_steppers();
  45. void disable_all_steppers();
  46. void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
  47. void minkill(const bool steppers_off=false);
  48. // Global State of the firmware
  49. enum MarlinState : uint8_t {
  50. MF_INITIALIZING = 0,
  51. MF_STOPPED,
  52. MF_KILLED,
  53. MF_RUNNING,
  54. MF_SD_COMPLETE,
  55. MF_PAUSED,
  56. MF_WAITING,
  57. };
  58. extern MarlinState marlin_state;
  59. inline bool IsRunning() { return marlin_state >= MF_RUNNING; }
  60. inline bool IsStopped() { return marlin_state == MF_STOPPED; }
  61. bool printingIsActive();
  62. bool printJobOngoing();
  63. bool printingIsPaused();
  64. void startOrResumeJob();
  65. extern bool wait_for_heatup;
  66. #if HAS_RESUME_CONTINUE
  67. extern bool wait_for_user;
  68. void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
  69. #endif
  70. bool pin_is_protected(const pin_t pin);
  71. #if HAS_SUICIDE
  72. inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
  73. #endif
  74. #if HAS_KILL
  75. #ifndef KILL_PIN_STATE
  76. #define KILL_PIN_STATE LOW
  77. #endif
  78. inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; }
  79. #endif
  80. extern const char M112_KILL_STR[];