Enable ADC2 for optional external supply voltage measurement
This commit is contained in:
parent
cc47c556e7
commit
c0e12ffa54
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue