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.

HAL_endstop_interrupts.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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. #ifndef HAL_ENDSTOP_INTERRUPTS_H_
  23. #define HAL_ENDSTOP_INTERRUPTS_H_
  24. volatile uint8_t e_hit = 0; // Different from 0 when the endstops should be tested in detail.
  25. // Must be reset to 0 by the test function when finished.
  26. // This is what is really done inside the interrupts.
  27. FORCE_INLINE void endstop_ISR_worker( void ) {
  28. e_hit = 2; // Because the detection of a e-stop hit has a 1 step debouncer it has to be called at least twice.
  29. }
  30. // One ISR for all EXT-Interrupts
  31. void endstop_ISR(void) { endstop_ISR_worker(); }
  32. #ifdef __AVR__
  33. #include "HAL_AVR/endstop_interrupts.h"
  34. #elif defined(ARDUINO_ARCH_SAM)
  35. #include "HAL_DUE/endstop_interrupts.h"
  36. #elif IS_32BIT_TEENSY
  37. #include "HAL_TEENSY35_36/endstop_interrupts.h"
  38. #elif defined(STM32F7)
  39. #include "HAL_STM32F7/endstop_interrupts.h"
  40. #else
  41. #error Unsupported Platform!
  42. #endif
  43. #endif /* HAL_ENDSTOP_INTERRUPTS_H_ */