🐛 Restore STM32 / STM32F1 12-bit ADC (#23871)
This commit is contained in:
parent
79b38e0e14
commit
b123fa763d
|
@ -335,7 +335,7 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
|||
_TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT)
|
||||
_TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTS)
|
||||
}
|
||||
adc_result = adc_results[(int)pin_index] >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits
|
||||
adc_result = (adc_results[(int)pin_index] & 0xFFF) >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits
|
||||
}
|
||||
|
||||
#endif // __STM32F1__
|
||||
|
|
|
@ -16,6 +16,7 @@ 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}
|
||||
|
|
|
@ -30,7 +30,6 @@ board = marlin_STM32G0B1RE
|
|||
board_build.offset = 0x2000
|
||||
board_upload.offset_address = 0x08002000
|
||||
build_flags = ${stm32_variant.build_flags}
|
||||
-DADC_RESOLUTION=12
|
||||
-DPIN_SERIAL4_RX=PC_11 -DPIN_SERIAL4_TX=PC_10
|
||||
-DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024
|
||||
-DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4
|
||||
|
|
Loading…
Reference in a new issue