Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore 12 bit ADC to STM32 and STM32F1 #23871

Merged
merged 2 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
1 change: 1 addition & 0 deletions ini/stm32-common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion ini/stm32g0.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down