From fb1c8ee0a34782bf0fb0d41155f01f282c333bde Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Tue, 8 Feb 2022 10:53:47 +0100 Subject: [PATCH] Change the pullup test --- Firmware/stepper.cpp | 5 ++++- Firmware/temperature.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index e83876b80..615e8cf7a 100644 --- a/Firmware/stepper.cpp +++ b/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 diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index c1d06c44d..2d1f163d4 100755 --- a/Firmware/temperature.cpp +++ b/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