Change the pullup test

This commit is contained in:
Alex Voinea 2022-02-08 10:53:47 +01:00
parent 8d0af30aa7
commit fb1c8ee0a3
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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