Browse Source

Change the pullup test

Alex Voinea 3 years ago
parent
commit
fb1c8ee0a3
2 changed files with 8 additions and 2 deletions
  1. 4 1
      Firmware/stepper.cpp
  2. 4 1
      Firmware/temperature.cpp

+ 4 - 1
Firmware/stepper.cpp

@@ -301,8 +301,11 @@ ISR(TIMER1_COMPA_vect) {
 
 #ifdef DEBUG_PULLUP_CRASH
     // check for faulty pull-ups enabled on thermistor inputs
-    if (PORTF & 0x5F)
+    if ((PORTF & (uint8_t)(ADC_DIDR_MSK & 0xff)) || (PORTK & (uint8_t)((ADC_DIDR_MSK >> 8) & 0xff)))
         pullup_error(false);
+#else
+    PORTF &= ~(uint8_t)(ADC_DIDR_MSK & 0xff);
+    PORTK &= ~(uint8_t)((ADC_DIDR_MSK >> 8) & 0xff);
 #endif // DEBUG_PULLUP_CRASH
 
 #ifdef LIN_ADVANCE

+ 4 - 1
Firmware/temperature.cpp

@@ -1685,8 +1685,11 @@ FORCE_INLINE static void temperature_isr()
 {
 #ifdef DEBUG_PULLUP_CRASH
     // check for faulty pull-ups enabled on thermistor inputs
-    if (PORTF & 0x5F)
+    if ((PORTF & (uint8_t)(ADC_DIDR_MSK & 0xff)) || (PORTK & (uint8_t)((ADC_DIDR_MSK >> 8) & 0xff)))
         pullup_error(true);
+#else
+    PORTF &= ~(uint8_t)(ADC_DIDR_MSK & 0xff);
+    PORTK &= ~(uint8_t)((ADC_DIDR_MSK >> 8) & 0xff);
 #endif // DEBUG_PULLUP_CRASH