mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-23 06:33:59 -06:00
stm32: Add an MACH_STM32F4x5 alias for F405, F407, and F429 chips
The F405, F407, and F429 chips are in the same series and almost all code definitions should apply to all chips in that series. Implement the alias and fix defintions in adc.c and Kconfig that were only applying to a subset of that series. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
c1136bef10
commit
e3905eb241
3 changed files with 18 additions and 15 deletions
|
@ -26,13 +26,13 @@ static const uint8_t adc_pins[] = {
|
|||
|
||||
#if CONFIG_MACH_STM32F1
|
||||
ADC_TEMPERATURE_PIN,
|
||||
#elif CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F405 || CONFIG_MACH_STM32F407
|
||||
#elif CONFIG_MACH_STM32F2 || CONFIG_MACH_STM32F4x5
|
||||
ADC_TEMPERATURE_PIN, 0x00, 0x00,
|
||||
#elif CONFIG_MACH_STM32F446
|
||||
0x00, 0x00, ADC_TEMPERATURE_PIN,
|
||||
#endif
|
||||
|
||||
#if CONFIG_MACH_STM32F405 || CONFIG_MACH_STM32F407 || CONFIG_MACH_STM32F446
|
||||
#if CONFIG_MACH_STM32F4x5 || CONFIG_MACH_STM32F446
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
GPIO('F', 6), GPIO('F', 7), GPIO('F', 8), GPIO('F', 9),
|
||||
GPIO('F', 10), GPIO('F', 3), 0x00, 0x00,
|
||||
|
@ -83,7 +83,7 @@ gpio_adc_setup(uint32_t pin)
|
|||
// Determine which ADC block to use
|
||||
ADC_TypeDef *adc = ADC1;
|
||||
uint32_t adc_base = ADC1_BASE;
|
||||
#if CONFIG_MACH_STM32F405 || CONFIG_MACH_STM32F407 || CONFIG_MACH_STM32F446
|
||||
#if CONFIG_MACH_STM32F4x5 || CONFIG_MACH_STM32F446
|
||||
if (chan >= 19) {
|
||||
// On the STM32F4, some ADC channels are only available from ADC3
|
||||
adc = ADC3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue