Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Revision 68:53d4cfd70523, committed 2016-02-19
- Comitter:
- MACRUM
- Date:
- Fri Feb 19 06:16:11 2016 +0000
- Parent:
- 67:4bcbbb9fcddf
- Commit message:
- Add state reset code in analogin_init() for Nucleo F303K8 target
Changed in this revision
targets/hal/TARGET_STM/TARGET_STM32F3/analogin_api.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/targets/hal/TARGET_STM/TARGET_STM32F3/analogin_api.c Thu Feb 18 10:00:10 2016 +0000 +++ b/targets/hal/TARGET_STM/TARGET_STM32F3/analogin_api.c Fri Feb 19 06:16:11 2016 +0000 @@ -73,14 +73,14 @@ #if defined(ADC1) if ((obj->adc == ADC_1) && adc1_inited) return; if (obj->adc == ADC_1) { - __ADC1_CLK_ENABLE(); + __ADC12_CLK_ENABLE(); adc1_inited = 1; } #endif #if defined(ADC2) if ((obj->adc == ADC_2) && adc2_inited) return; if (obj->adc == ADC_2) { - __ADC2_CLK_ENABLE(); + __ADC12_CLK_ENABLE(); adc2_inited = 1; } #endif @@ -115,6 +115,8 @@ AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; AdcHandle.Init.DMAContinuousRequests = DISABLE; AdcHandle.Init.Overrun = OVR_DATA_OVERWRITTEN; + + __HAL_ADC_RESET_HANDLE_STATE(&AdcHandle); if (HAL_ADC_Init(&AdcHandle) != HAL_OK) { error("Cannot initialize ADC");