Skip to content

Commit 27bf7d2

Browse files
committed
STM32F7 : internal ADC channels
1 parent 803ab18 commit 27bf7d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/TARGET_STM32F7/analogin_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void analogin_init(analogin_t *obj, PinName pin)
5151
#endif
5252
// ADC Internal Channels "pins" (Temperature, Vref, Vbat, ...)
5353
// are described in PinNames.h and PeripheralPins.c
54-
// Pin value must be >= 0xF0
55-
if (pin < 0xF0) {
54+
// Pin value must be between 0xF0 and 0xFF
55+
if ((pin < 0xF0) || (pin >= 0x100)) {
5656
// Normal channels
5757
// Get the peripheral name from the pin and assign it to the object
5858
obj->handle.Instance = (ADC_TypeDef *) pinmap_peripheral(pin, PinMap_ADC);

0 commit comments

Comments
 (0)