Skip to content

Commit

Permalink
🐛 Restore STM32 / STM32F1 12-bit ADC (MarlinFirmware#23871)
Browse files Browse the repository at this point in the history
  • Loading branch information
tombrazier authored and LCh-77 committed Mar 16, 2022
1 parent 2657d92 commit 0a0597c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
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

0 comments on commit 0a0597c

Please sign in to comment.