Skip to content

Commit 80e942b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents b95c53a + 9960b6e commit 80e942b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cores/arduino/Arduino.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
#ifndef Arduino_h
2121
#define Arduino_h
2222

23+
#ifndef GCC_VERSION
24+
#define GCC_VERSION (__GNUC__ * 10000 \
25+
+ __GNUC_MINOR__ * 100 \
26+
+ __GNUC_PATCHLEVEL__)
27+
#endif
28+
#if GCC_VERSION < 60300
29+
#error "GCC version 6.3 or higher is required"
30+
#endif
31+
2332
#include "wiring.h"
2433

2534
/* sketch */

cores/arduino/stm32/analog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,11 @@ uint16_t adc_read_value(PinName pin)
606606
AdcChannelConf.Rank = ADC_REGULAR_RANK_1; /* Specifies the rank in the regular group sequencer */
607607
#ifndef STM32L0xx
608608
AdcChannelConf.SamplingTime = SAMPLINGTIME; /* Sampling time value to be set for the selected channel */
609+
#endif
610+
#if defined (STM32F3xx) || defined (STM32L4xx)
611+
AdcChannelConf.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
612+
AdcChannelConf.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
613+
AdcChannelConf.Offset = 0; /* Parameter discarded because offset correction is disabled */
609614
#endif
610615
/*##-2- Configure ADC regular channel ######################################*/
611616
if (HAL_ADC_ConfigChannel(&AdcHandle, &AdcChannelConf) != HAL_OK)

0 commit comments

Comments
 (0)