Browse Source

🐛 STM32 ADC Resolution = 12 bit (or ADC_RESOLUTION) (#22789)

vanilla_fb_2.0.x
Steven Haigh 3 years ago
committed by Scott Lahteine
parent
commit
2630eefcc4
  1. 7
      Marlin/src/HAL/STM32/HAL.h
  2. 7
      Marlin/src/HAL/STM32F1/HAL.h
  3. 1
      ini/stm32-common.ini

7
Marlin/src/HAL/STM32/HAL.h

@ -183,8 +183,13 @@ static inline int freeMemory() {
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
#ifdef ADC_RESOLUTION
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
#else
#define HAL_ADC_RESOLUTION 12
#endif
#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION ADC_RESOLUTION // 12
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true

7
Marlin/src/HAL/STM32F1/HAL.h

@ -237,8 +237,13 @@ static inline int freeMemory() {
void HAL_adc_init();
#ifdef ADC_RESOLUTION
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
#else
#define HAL_ADC_RESOLUTION 12
#endif
#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true

1
ini/stm32-common.ini

@ -16,7 +16,6 @@ build_flags = ${common.build_flags}
-std=gnu++14 -DHAL_STM32
-DUSBCON -DUSBD_USE_CDC
-DTIM_IRQ_PRIO=13
-DADC_RESOLUTION=12
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/backtrace>
extra_scripts = ${common.extra_scripts}

Loading…
Cancel
Save