diff options
-rw-r--r-- | os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c | 10 | ||||
-rw-r--r-- | testhal/STM32/multi/ADC/debug/STM32-ADC (Select ELF file)(OpenOCD, Flash and Run).launch | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c b/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c index b45aef900..6762ec8e6 100644 --- a/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c +++ b/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c @@ -153,16 +153,18 @@ static void adc_lld_calibrate(ADCDriver *adcp) { osalDbgAssert(adcp->adcm->CR == ADC_CR_ADVREGEN, "invalid register state");
- adcp->adcm->CR = adcp->config->calibration & (ADC_CR_ADCALDIF |
- ADC_CR_ADCALLIN);
+ adcp->adcm->CR &= ~(ADC_CR_ADCALDIF | ADC_CR_ADCALLIN);
+ adcp->adcm->CR |= adcp->config->calibration & (ADC_CR_ADCALDIF |
+ ADC_CR_ADCALLIN);
adcp->adcm->CR |= ADC_CR_ADCAL;
while ((adcp->adcm->CR & ADC_CR_ADCAL) != 0U)
;
#if STM32_ADC_DUAL_MODE
osalDbgAssert(adcp->adcs->CR == ADC_CR_ADVREGEN, "invalid register state");
- adcp->adcs->CR = adcp->config->calibration & (ADC_CR_ADCALDIF |
- ADC_CR_ADCALLIN);
+ adcp->adcs->CR &= ~(ADC_CR_ADCALDIF | ADC_CR_ADCALLIN);
+ adcp->adcs->CR |= adcp->config->calibration & (ADC_CR_ADCALDIF |
+ ADC_CR_ADCALLIN);
adcp->adcs->CR |= ADC_CR_ADCAL;
while ((adcp->adcs->CR & ADC_CR_ADCAL) != 0U)
;
diff --git a/testhal/STM32/multi/ADC/debug/STM32-ADC (Select ELF file)(OpenOCD, Flash and Run).launch b/testhal/STM32/multi/ADC/debug/STM32-ADC (Select ELF file)(OpenOCD, Flash and Run).launch index 98cf3d524..be98c7537 100644 --- a/testhal/STM32/multi/ADC/debug/STM32-ADC (Select ELF file)(OpenOCD, Flash and Run).launch +++ b/testhal/STM32/multi/ADC/debug/STM32-ADC (Select ELF file)(OpenOCD, Flash and Run).launch @@ -33,7 +33,7 @@ <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> -<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="rand[31]-rand-main-(format)" val="4"/><content id="rand[30]-rand-main-(format)" val="4"/><content id="rand[29]-rand-main-(format)" val="4"/><content id="rand[28]-rand-main-(format)" val="4"/><content id="rand[27]-rand-main-(format)" val="4"/><content id="rand[26]-rand-main-(format)" val="4"/><content id="rand[25]-rand-main-(format)" val="4"/><content id="rand[24]-rand-main-(format)" val="4"/><content id="rand[23]-rand-main-(format)" val="4"/><content id="rand[22]-rand-main-(format)" val="4"/><content id="rand[21]-rand-main-(format)" val="4"/><content id="rand[20]-rand-main-(format)" val="4"/><content id="rand[19]-rand-main-(format)" val="4"/><content id="rand[18]-rand-main-(format)" val="4"/><content id="rand[17]-rand-main-(format)" val="4"/><content id="rand[16]-rand-main-(format)" val="4"/><content id="rand[15]-rand-main-(format)" val="4"/><content id="rand[14]-rand-main-(format)" val="4"/><content id="rand[13]-rand-main-(format)" val="4"/><content id="rand[12]-rand-main-(format)" val="4"/><content id="rand[11]-rand-main-(format)" val="4"/><content id="rand[10]-rand-main-(format)" val="4"/><content id="rand[9]-rand-main-(format)" val="4"/><content id="rand[8]-rand-main-(format)" val="4"/><content id="rand[7]-rand-main-(format)" val="4"/><content id="rand[6]-rand-main-(format)" val="4"/><content id="rand[5]-rand-main-(format)" val="4"/><content id="rand[4]-rand-main-(format)" val="4"/><content id="rand[3]-rand-main-(format)" val="4"/><content id="rand[2]-rand-main-(format)" val="4"/><content id="rand[1]-rand-main-(format)" val="4"/><content id="rand[0]-rand-main-(format)" val="4"/><content id="xPSR-(format)" val="4"/><content id="mfs_buffer[447]-null-mfs_test_001_005_execute-(format)" val="0"/><content id="mfs_buffer[507]-null-mfs_test_001_005_execute-(format)" val="0"/><content id="rp[506]-rp-mfs_flash_read-(format)" val="0"/><content id="rp[507]-rp-mfs_flash_read-(format)" val="0"/><content id="rp-mfs_flash_read-(cast_to_array)" val="0:511"/><content id="rand-main-(format)" val="4"/></contentList>"/> +<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="rand-main-(format)" val="4"/><content id="rp-mfs_flash_read-(cast_to_array)" val="0:511"/><content id="rp[507]-rp-mfs_flash_read-(format)" val="0"/><content id="rp[506]-rp-mfs_flash_read-(format)" val="0"/><content id="mfs_buffer[507]-null-mfs_test_001_005_execute-(format)" val="0"/><content id="mfs_buffer[447]-null-mfs_test_001_005_execute-(format)" val="0"/><content id="xPSR-(format)" val="4"/><content id="rand[0]-rand-main-(format)" val="4"/><content id="rand[1]-rand-main-(format)" val="4"/><content id="rand[2]-rand-main-(format)" val="4"/><content id="rand[3]-rand-main-(format)" val="4"/><content id="rand[4]-rand-main-(format)" val="4"/><content id="rand[5]-rand-main-(format)" val="4"/><content id="rand[6]-rand-main-(format)" val="4"/><content id="rand[7]-rand-main-(format)" val="4"/><content id="rand[8]-rand-main-(format)" val="4"/><content id="rand[9]-rand-main-(format)" val="4"/><content id="rand[10]-rand-main-(format)" val="4"/><content id="rand[11]-rand-main-(format)" val="4"/><content id="rand[12]-rand-main-(format)" val="4"/><content id="rand[13]-rand-main-(format)" val="4"/><content id="rand[14]-rand-main-(format)" val="4"/><content id="rand[15]-rand-main-(format)" val="4"/><content id="rand[16]-rand-main-(format)" val="4"/><content id="rand[17]-rand-main-(format)" val="4"/><content id="rand[18]-rand-main-(format)" val="4"/><content id="rand[19]-rand-main-(format)" val="4"/><content id="rand[20]-rand-main-(format)" val="4"/><content id="rand[21]-rand-main-(format)" val="4"/><content id="rand[22]-rand-main-(format)" val="4"/><content id="rand[23]-rand-main-(format)" val="4"/><content id="rand[24]-rand-main-(format)" val="4"/><content id="rand[25]-rand-main-(format)" val="4"/><content id="rand[26]-rand-main-(format)" val="4"/><content id="rand[27]-rand-main-(format)" val="4"/><content id="rand[28]-rand-main-(format)" val="4"/><content id="rand[29]-rand-main-(format)" val="4"/><content id="rand[30]-rand-main-(format)" val="4"/><content id="rand[31]-rand-main-(format)" val="4"/></contentList>"/> <stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/> <stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x20000c34"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/> <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${selected_resource_loc}"/> |