From 9ff4e9e1e61a68aa30e7ec1205f3404d38328dda Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sat, 7 Apr 2018 23:29:00 -0500
Subject: [PATCH] Patch _IS_HW_SPI so defined() works

---
 Marlin/src/HAL/HAL_DUE/SanityCheck_Due.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Marlin/src/HAL/HAL_DUE/SanityCheck_Due.h b/Marlin/src/HAL/HAL_DUE/SanityCheck_Due.h
index d6dea24220..16e07bd3b4 100644
--- a/Marlin/src/HAL/HAL_DUE/SanityCheck_Due.h
+++ b/Marlin/src/HAL/HAL_DUE/SanityCheck_Due.h
@@ -39,11 +39,11 @@
  * Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time
  * as the TMC2130 soft SPI the most common setup.
  */
-#define _IS_HW_SPI(P) (defined(P) && (P == MOSI_PIN || P == MISO_PIN || P == SCK_PIN))
+#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN))
 
 #if ENABLED(SDSUPPORT) && ENABLED(HAVE_TMC2130)
   #if ENABLED(TMC_USE_SW_SPI)
-    #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(TMC_SW_MOSI) || _IS_HW_SPI(TMC_SW_MISO) || _IS_HW_SPI(TMC_SW_SCK))
+    #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
       #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
     #endif
   #elif ENABLED(DUE_SOFTWARE_SPI)
-- 
GitLab