File tree 2 files changed +4
-8
lines changed
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)
564
564
#ifndef STM32F1xx
565
565
AdcHandle .Init .ClockPrescaler = ADC_CLOCK_DIV ; /* Asynchronous clock mode, input ADC clock divided */
566
566
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) */
567
570
#endif
568
571
AdcHandle .Init .DataAlign = ADC_DATAALIGN_RIGHT ; /* Right-alignment for converted data */
569
572
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
573
573
AdcHandle .Init .ContinuousConvMode = DISABLE ; /* Continuous mode disabled to have only 1 conversion at each conversion trig */
574
574
AdcHandle .Init .DiscontinuousConvMode = DISABLE ; /* Parameter discarded because sequencer is disabled */
575
575
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
580
576
AdcHandle .State = HAL_ADC_STATE_RESET ;
581
577
#if defined (STM32F0xx ) || defined (STM32L0xx )
582
578
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) {
528
528
void HAL_UART_ErrorCallback (UART_HandleTypeDef * huart )
529
529
{
530
530
volatile uint32_t tmpval ;
531
- #if defined(STM32F4xx ) || defined(STM32F1xx )
531
+ #if defined(STM32F1xx ) || defined(STM32F4xx )
532
532
if (__HAL_UART_GET_FLAG (huart , UART_FLAG_PE ) != RESET ) {
533
533
tmpval = huart -> Instance -> DR ; // Clear PE flag
534
534
} else if (__HAL_UART_GET_FLAG (huart , UART_FLAG_FE ) != RESET ) {
You can’t perform that action at this time.
0 commit comments