Skip to content

Commit 716ad1d

Browse files
committed
ADC Calibration for g4 and l4
1 parent 0caaf03 commit 716ad1d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/current_sense/hardware_specific/stm32/stm32g4/stm32g4_mcu.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ void _driverSyncLowSide(void* _driver_params, void* _cs_params){
6161

6262
// set the trigger output event
6363
LL_TIM_SetTriggerOutput(cs_params->timer_handle->getHandle()->Instance, LL_TIM_TRGO_UPDATE);
64+
65+
// Start the adc calibration
66+
HAL_ADCEx_Calibration_Start(cs_params->adc_handle,ADC_SINGLE_ENDED);
67+
6468
// start the adc
6569
HAL_ADCEx_InjectedStart_IT(cs_params->adc_handle);
6670
// restart all the timers of the driver

src/current_sense/hardware_specific/stm32/stm32l4/stm32l4_mcu.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ void _driverSyncLowSide(void* _driver_params, void* _cs_params){
6161

6262
// set the trigger output event
6363
LL_TIM_SetTriggerOutput(cs_params->timer_handle->getHandle()->Instance, LL_TIM_TRGO_UPDATE);
64+
65+
// Start the adc calibration
66+
HAL_ADCEx_Calibration_Start(cs_params->adc_handle,ADC_SINGLE_ENDED);
67+
6468
// start the adc
6569
HAL_ADCEx_InjectedStart_IT(cs_params->adc_handle);
6670
// restart all the timers of the driver

0 commit comments

Comments
 (0)