Allow to use up to 6xADC channels (now hardcoded), disabling the user button

(PA3) if ADC6 is enabled
This commit is contained in:
Toni Lozano 2016-04-04 10:48:43 +02:00
parent fb31d8d641
commit a81b4007b0
7 changed files with 210 additions and 54 deletions

View file

@ -175,7 +175,7 @@ configure(int type, int value)
return ADC_WRAPPER_ERROR;
}
if((value < 0x01) || (value > 0x07) || (value == BUTTON_USER_PIN)) {
if((value < 0x01) || (value > 0x07) || ((value == BUTTON_USER_PIN) && (ADC_SENSORS_ADC6_PIN < 0))) {
PRINTF("ADC sensors: invalid pin value, (PA0-PA1, PA3) are reserved\n");
return ADC_WRAPPER_ERROR;
}