mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Enable ADC2 for optional external supply voltage measurement
This commit is contained in:
parent
cc47c556e7
commit
c0e12ffa54
@ -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.
|
* \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.
|
* \retval 0 Place holder for returning status.
|
||||||
*/
|
*/
|
||||||
@ -124,6 +125,12 @@ temp_init(void)
|
|||||||
TEMP_DDR &= ~(1 << TEMP_BIT_IN);
|
TEMP_DDR &= ~(1 << TEMP_BIT_IN);
|
||||||
TEMP_PORT &= ~(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;
|
temp_initialized = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user