STM32xx - Change how the ADC internal pins are checked before pinmap_pinout

pull/3013/head
bcostm 2016-10-13 16:28:57 +02:00
parent 1ba3499631
commit a484f51904
9 changed files with 27 additions and 18 deletions

View File

@ -50,8 +50,9 @@ void analogin_init(analogin_t *obj, PinName pin) {
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -52,8 +52,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref)
if ((obj->channel != 16) && (obj->channel != 17)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -58,8 +58,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -62,8 +62,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -58,8 +58,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -59,8 +59,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -51,8 +51,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vlcd)
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -53,8 +53,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref)
if ((obj->channel != 16) && (obj->channel != 17)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}

View File

@ -51,8 +51,9 @@ void analogin_init(analogin_t *obj, PinName pin)
MBED_ASSERT(function != (uint32_t)NC);
obj->channel = STM_PIN_CHANNEL(function);
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
if ((obj->channel != 0) && (obj->channel != 17) && (obj->channel != 18)) {
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
if (pin < 0xF0) {
pinmap_pinout(pin, PinMap_ADC);
}