Skip to content

Commit

Permalink
STM32H7 ADC: No MultiMode configuration needed for ADC2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecoutant committed Sep 1, 2020
1 parent 4ef38f9 commit 02c79e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32H7/analogin_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ void analogin_init(analogin_t *obj, PinName pin)
error("analogin_init HAL_ADC_Init");
}

if ( ((ADCName)obj->handle.Instance == ADC_1) || ((ADCName)obj->handle.Instance == ADC_2) ) {
if ((ADCName)obj->handle.Instance == ADC_1) {
ADC_MultiModeTypeDef multimode = {0};
multimode.Mode = ADC_MODE_INDEPENDENT;
if (HAL_ADCEx_MultiModeConfigChannel(&obj->handle, &multimode) != HAL_OK) {
error("analogin_init HAL_ADC_Init");
error("HAL_ADCEx_MultiModeConfigChannel HAL_ADC_Init");
}
}

Expand Down

0 comments on commit 02c79e8

Please sign in to comment.