From c0e12ffa54f6c4b22d4e109ed3bfeba003792bf7 Mon Sep 17 00:00:00 2001 From: dak664 Date: Thu, 11 Feb 2010 21:58:51 +0000 Subject: [PATCH] Enable ADC2 for optional external supply voltage measurement --- platform/avr-ravenlcd/temp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/avr-ravenlcd/temp.c b/platform/avr-ravenlcd/temp.c index 72292abad..cf7c20c31 100644 --- a/platform/avr-ravenlcd/temp.c +++ b/platform/avr-ravenlcd/temp.c @@ -105,6 +105,7 @@ static int find_temp(int16_t value, uint16_t* array, int count); /** * \brief This will initialize the digital IO and adc channel for temperture readings. + * Optionally enable adc channel 2 for measurement of EXT_SUPL_SIG. * * \retval 0 Place holder for returning status. */ @@ -124,6 +125,12 @@ temp_init(void) TEMP_DDR &= ~(1 << TEMP_BIT_IN); TEMP_PORT &= ~(1 << TEMP_BIT_IN); +#if MEASURE_ADC2 + DIDR0 |= (1 << ADC2D); + TEMP_DDR &= ~(1 << 2); + TEMP_PORT &= ~(1 << 2); +#endif + temp_initialized = true; return 0;