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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #ifndef HAL_ENDSTOP_INTERRUPTS_H_
  20. #define HAL_ENDSTOP_INTERRUPTS_H_
  21. volatile uint8_t e_hit = 0; // Different from 0 when the endstops should be tested in detail.
  22. // Must be reset to 0 by the test function when finished.
  23. // This is what is really done inside the interrupts.
  24. FORCE_INLINE void endstop_ISR_worker( void ) {
  25. e_hit = 2; // Because the detection of a e-stop hit has a 1 step debouncer it has to be called at least twice.
  26. }
  27. // One ISR for all EXT-Interrupts
  28. void endstop_ISR(void) { endstop_ISR_worker(); }
  29. #ifdef ARDUINO_ARCH_AVR
  30. #include "HAL_AVR/endstop_interrupts.h"
  31. #elif defined(ARDUINO_ARCH_SAM)
  32. #include "HAL_DUE/endstop_interrupts.h"
  33. #elif IS_32BIT_TEENSY
  34. #include "HAL_TEENSY35_36/endstop_interrupts.h"
  35. #else
  36. #error Unsupported Platform!
  37. #endif
  38. #endif /* HAL_ENDSTOP_INTERRUPTS_H_ */