mirror of https://github.com/ARMmbed/mbed-os.git
STM32L0 : internal ADC channels
parent
43967d7c75
commit
dbee9a2066
|
@ -45,8 +45,8 @@ void analogin_init(analogin_t *obj, PinName pin)
|
||||||
|
|
||||||
// ADC Internal Channels "pins" (Temperature, Vref, Vbat, ...)
|
// ADC Internal Channels "pins" (Temperature, Vref, Vbat, ...)
|
||||||
// are described in PinNames.h and PeripheralPins.c
|
// are described in PinNames.h and PeripheralPins.c
|
||||||
// Pin value must be >= 0xF0
|
// Pin value must be between 0xF0 and 0xFF
|
||||||
if (pin < 0xF0) {
|
if ((pin < 0xF0) || (pin >= 0x100)) {
|
||||||
// Normal channels
|
// Normal channels
|
||||||
// Get the peripheral name from the pin and assign it to the object
|
// Get the peripheral name from the pin and assign it to the object
|
||||||
obj->handle.Instance = (ADC_TypeDef *)pinmap_peripheral(pin, PinMap_ADC);
|
obj->handle.Instance = (ADC_TypeDef *)pinmap_peripheral(pin, PinMap_ADC);
|
||||||
|
|
Loading…
Reference in New Issue