diff options
-rw-r--r-- | os/hal/platforms/STM32F37x/adc_lld.c | 4 | ||||
-rw-r--r-- | testhal/STM32F37x/ADC/main.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32F37x/adc_lld.c b/os/hal/platforms/STM32F37x/adc_lld.c index 98af50a75..ad1979ae3 100644 --- a/os/hal/platforms/STM32F37x/adc_lld.c +++ b/os/hal/platforms/STM32F37x/adc_lld.c @@ -502,12 +502,12 @@ void adc_lld_start_conversion(ADCDriver *adcp) { /* ADC setup.*/
adcp->adc->SR = 0;
- adcp->adc->LTR = grpp->u.adc.htr;
+ adcp->adc->LTR = grpp->u.adc.ltr;
adcp->adc->HTR = grpp->u.adc.htr;
adcp->adc->SMPR1 = grpp->u.adc.smpr[0];
adcp->adc->SMPR2 = grpp->u.adc.smpr[1];
adcp->adc->SQR1 = grpp->u.adc.sqr[0] |
- ADC_SQR1_NUM_CH(grpp->num_channels);
+ ADC_SQR1_NUM_CH(grpp->num_channels);
adcp->adc->SQR2 = grpp->u.adc.sqr[1];
adcp->adc->SQR3 = grpp->u.adc.sqr[2];
diff --git a/testhal/STM32F37x/ADC/main.c b/testhal/STM32F37x/ADC/main.c index 20e8ff8db..512583a33 100644 --- a/testhal/STM32F37x/ADC/main.c +++ b/testhal/STM32F37x/ADC/main.c @@ -149,6 +149,7 @@ int main(void) { * measurement.
*/
adcStart(&ADCD1, NULL);
+ adcSTM32Calibrate(&ADCD1);
adcSTM32EnableTSVREFE();
adcSTM32EnableVBATE();
|