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.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #include <math.h>
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. void stop();
  28. // Pass true to keep steppers from timing out
  29. void idle(bool no_stepper_sleep=false);
  30. inline void idle_no_sleep() { idle(true); }
  31. #if ENABLED(G38_PROBE_TARGET)
  32. extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
  33. extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
  34. #endif
  35. void kill(FSTR_P const lcd_error=nullptr, FSTR_P const lcd_component=nullptr, const bool steppers_off=false);
  36. void minkill(const bool steppers_off=false);
  37. // Global State of the firmware
  38. enum MarlinState : uint8_t {
  39. MF_INITIALIZING = 0,
  40. MF_STOPPED,
  41. MF_KILLED,
  42. MF_RUNNING,
  43. MF_SD_COMPLETE,
  44. MF_PAUSED,
  45. MF_WAITING,
  46. };
  47. extern MarlinState marlin_state;
  48. inline bool IsRunning() { return marlin_state >= MF_RUNNING; }
  49. inline bool IsStopped() { return marlin_state == MF_STOPPED; }
  50. bool printingIsActive();
  51. bool printJobOngoing();
  52. bool printingIsPaused();
  53. void startOrResumeJob();
  54. bool printer_busy();
  55. extern bool wait_for_heatup;
  56. #if HAS_RESUME_CONTINUE
  57. extern bool wait_for_user;
  58. void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
  59. #endif
  60. bool pin_is_protected(const pin_t pin);
  61. #if HAS_SUICIDE
  62. inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_STATE); }
  63. #endif
  64. #if HAS_KILL
  65. #ifndef KILL_PIN_STATE
  66. #define KILL_PIN_STATE LOW
  67. #endif
  68. inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; }
  69. #endif
  70. extern const char M112_KILL_STR[];