diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index 7d0e780e9ca763d585a3e103b85623a157c187d3..18658fe9f59b46f16adffaa1408506df7ebce14a 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -128,21 +128,10 @@ uint32_t analogRead( uint32_t ulPin ) while ( DAC->STATUS.bit.SYNCBUSY == 1 ); } - if (ulPin != TEMP) - { - pinPeripheral(ulPin, g_APinDescription[ulPin].ulPinType); - - while ( ADC->STATUS.bit.SYNCBUSY == 1 ); - ADC->INPUTCTRL.bit.MUXPOS = g_APinDescription[ulPin].ulADCChannelNumber; // Selection for the positive ADC input - } - else - { - while ( ADC->STATUS.bit.SYNCBUSY == 1 ); - ADC->INPUTCTRL.bit.MUXPOS = ulPin & 0x7F; // Selection for the positive ADC input - //ADC->INPUTCTRL.bit.MUXPOS = 0x18; // Selection for the positive ADC input + pinPeripheral(ulPin, g_APinDescription[ulPin].ulPinType); - SYSCTRL->VREF.bit.TSEN = 0x1; // Temperature sensor is enabled and routed to an ADC input channel. - } + while ( ADC->STATUS.bit.SYNCBUSY == 1 ); + ADC->INPUTCTRL.bit.MUXPOS = g_APinDescription[ulPin].ulADCChannelNumber; // Selection for the positive ADC input // Control A /* diff --git a/variants/arduino_zero/variant.h b/variants/arduino_zero/variant.h index da0eaf39dc101353f4bd23c80af6ab65041c9c8c..ab7050cefcff23b1c51a6c0525b10002822379ac 100644 --- a/variants/arduino_zero/variant.h +++ b/variants/arduino_zero/variant.h @@ -92,7 +92,6 @@ static const uint8_t A2 = PIN_A2 ; static const uint8_t A3 = PIN_A3 ; static const uint8_t A4 = PIN_A4 ; static const uint8_t A5 = PIN_A5 ; -static const uint8_t TEMP = 0x98 ; #define ADC_RESOLUTION 12 /*