From a594bc32c71d46320400999f02fbbb6e5043f6b9 Mon Sep 17 00:00:00 2001
From: Cristian Maglie <c.maglie@arduino.cc>
Date: Fri, 26 Sep 2014 12:58:03 +0200
Subject: [PATCH]  removed TEMP read from analog API

---
 cores/arduino/wiring_analog.c   | 17 +++--------------
 variants/arduino_zero/variant.h |  1 -
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c
index 7d0e780e..18658fe9 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 da0eaf39..ab7050ce 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
 
 /*
-- 
GitLab