From c31e1735dd3dcd8eb45231c03144cd6cfdc1ffd4 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Mon, 5 Nov 2018 06:11:34 -0600
Subject: [PATCH] Restore LPC1768_PIN_INTERRUPT_M, apply to Z3

- In reference to #12166
---
 Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
index a155345926..3d0b472d1e 100644
--- a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
+++ b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
@@ -90,9 +90,15 @@ void setup_endstop_interrupts(void) {
     attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
   #endif
   #if HAS_Z3_MAX
+    #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
+      #error "Z3_MIN_PIN is not an INTERRUPT capable pin."
+    #endif
     attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
   #endif
   #if HAS_Z3_MIN
+    #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
+      #error "Z3_MIN_PIN is not an INTERRUPT capable pin."
+    #endif
     attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
   #endif
   #if HAS_Z_MIN_PROBE_PIN
-- 
GitLab