File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -564,19 +564,15 @@ uint16_t adc_read_value(PinName pin)
564564#ifndef STM32F1xx
565565 AdcHandle .Init .ClockPrescaler = ADC_CLOCK_DIV ; /* Asynchronous clock mode, input ADC clock divided */
566566 AdcHandle .Init .Resolution = ADC_RESOLUTION_12B ; /* 12-bit resolution for converted data */
567+ AdcHandle .Init .EOCSelection = ADC_EOC_SINGLE_CONV ; /* EOC flag picked-up to indicate conversion end */
568+ AdcHandle .Init .ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE ; /* Parameter discarded because software trigger chosen */
569+ AdcHandle .Init .DMAContinuousRequests = DISABLE ; /* DMA one-shot mode selected (not applied to this example) */
567570#endif
568571 AdcHandle .Init .DataAlign = ADC_DATAALIGN_RIGHT ; /* Right-alignment for converted data */
569572 AdcHandle .Init .ScanConvMode = DISABLE ; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
570- #ifndef STM32F1xx
571- AdcHandle .Init .EOCSelection = ADC_EOC_SINGLE_CONV ; /* EOC flag picked-up to indicate conversion end */
572- #endif
573573 AdcHandle .Init .ContinuousConvMode = DISABLE ; /* Continuous mode disabled to have only 1 conversion at each conversion trig */
574574 AdcHandle .Init .DiscontinuousConvMode = DISABLE ; /* Parameter discarded because sequencer is disabled */
575575 AdcHandle .Init .ExternalTrigConv = ADC_SOFTWARE_START ; /* Software start to trig the 1st conversion manually, without external event */
576- #ifndef STM32F1xx
577- AdcHandle .Init .ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE ; /* Parameter discarded because software trigger chosen */
578- AdcHandle .Init .DMAContinuousRequests = DISABLE ; /* DMA one-shot mode selected (not applied to this example) */
579- #endif
580576 AdcHandle .State = HAL_ADC_STATE_RESET ;
581577#if defined (STM32F0xx ) || defined (STM32L0xx )
582578 AdcHandle .Init .LowPowerAutoWait = DISABLE ; /* Auto-delayed conversion feature disabled */
Original file line number Diff line number Diff line change @@ -528,7 +528,7 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
528528void HAL_UART_ErrorCallback (UART_HandleTypeDef * huart )
529529{
530530 volatile uint32_t tmpval ;
531- #if defined(STM32F4xx ) || defined(STM32F1xx )
531+ #if defined(STM32F1xx ) || defined(STM32F4xx )
532532 if (__HAL_UART_GET_FLAG (huart , UART_FLAG_PE ) != RESET ) {
533533 tmpval = huart -> Instance -> DR ; // Clear PE flag
534534 } else if (__HAL_UART_GET_FLAG (huart , UART_FLAG_FE ) != RESET ) {
You can’t perform that action at this time.
0 commit comments