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 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 <http://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. #if HAS_L64XX
  31. #include "libs/L64XX/L64XX_Marlin.h"
  32. extern uint8_t axis_known_position;
  33. #endif
  34. void stop();
  35. void idle(
  36. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  37. bool no_stepper_sleep=false // Pass true to keep steppers from timing out
  38. #endif
  39. );
  40. inline void idle_no_sleep() {
  41. idle(
  42. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  43. true
  44. #endif
  45. );
  46. }
  47. #if ENABLED(EXPERIMENTAL_I2CBUS)
  48. #include "feature/twibus.h"
  49. extern TWIBus i2c;
  50. #endif
  51. #if ENABLED(G38_PROBE_TARGET)
  52. extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
  53. extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
  54. #endif
  55. /**
  56. * The axis order in all axis related arrays is X, Y, Z, E
  57. */
  58. void enable_e_steppers();
  59. void enable_all_steppers();
  60. void disable_e_stepper(const uint8_t e);
  61. void disable_e_steppers();
  62. void disable_all_steppers();
  63. void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
  64. void minkill(const bool steppers_off=false);
  65. void quickstop_stepper();
  66. extern bool Running;
  67. inline bool IsRunning() { return Running; }
  68. inline bool IsStopped() { return !Running; }
  69. bool printingIsActive();
  70. bool printingIsPaused();
  71. void startOrResumeJob();
  72. extern bool wait_for_heatup;
  73. #if HAS_RESUME_CONTINUE
  74. extern bool wait_for_user;
  75. #endif
  76. // Inactivity shutdown timer
  77. extern millis_t max_inactive_time, stepper_inactive_time;
  78. #if ENABLED(USE_CONTROLLER_FAN)
  79. extern uint8_t controllerfan_speed;
  80. #endif
  81. #if ENABLED(PSU_CONTROL)
  82. extern bool powersupply_on;
  83. #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0)
  84. #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0)
  85. #if ENABLED(AUTO_POWER_CONTROL)
  86. #define PSU_ON() powerManager.power_on()
  87. #define PSU_OFF() powerManager.power_off()
  88. #else
  89. #define PSU_ON() PSU_PIN_ON()
  90. #define PSU_OFF() PSU_PIN_OFF()
  91. #endif
  92. #endif
  93. bool pin_is_protected(const pin_t pin);
  94. void protected_pin_err();
  95. #if HAS_SUICIDE
  96. inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
  97. #endif
  98. #if ENABLED(G29_RETRY_AND_RECOVER)
  99. void event_probe_recover();
  100. void event_probe_failure();
  101. #endif
  102. extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
  103. SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
  104. X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];