Skip to content

Commit 213b44d

Browse files
committed
STM32F3xx - Disable GPIO configuration for ADC internal channels
1 parent 157fa65 commit 213b44d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32F3/analogin_api.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2015, STMicroelectronics
2+
* Copyright (c) 2016, STMicroelectronics
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -62,8 +62,10 @@ void analogin_init(analogin_t *obj, PinName pin)
6262
MBED_ASSERT(function != (uint32_t)NC);
6363
obj->channel = STM_PIN_CHANNEL(function);
6464

65-
// Configure GPIO
66-
pinmap_pinout(pin, PinMap_ADC);
65+
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
66+
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
67+
pinmap_pinout(pin, PinMap_ADC);
68+
}
6769

6870
// Save pin number for the read function
6971
obj->pin = pin;

0 commit comments

Comments
 (0)