STM32L4 AnalogIn init issue with _ALT pins

pull/4824/head
jeromecoutant 2017-07-17 13:33:50 +02:00 committed by Martin Kojtal
parent 8e989b072d
commit 70c5407697
1 changed files with 2 additions and 2 deletions

View File

@ -47,8 +47,8 @@ void analogin_init(analogin_t *obj, PinName pin)
// ADC Internal Channels "pins" (Temperature, Vref, Vbat, ...)
// are described in PinNames.h and PeripheralPins.c
// Pin value must be >= 0xF0
if (pin < 0xF0) {
// Pin value must be between 0xF0 and 0xFF
if ((pin < 0xF0) || (pin >= 0x100)) {
// Normal channels
// Get the peripheral name from the pin and assign it to the object
obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC);