Browse Source

Allow STM32 HAL_TIMER_RATE override (#18374)

Chris Barr 5 years ago
parent
commit
900d4cf8e7
No account linked to committer's email address

+ 7
- 4
Marlin/src/HAL/STM32/timers.cpp View File

44
 #endif
44
 #endif
45
 
45
 
46
 #ifdef STM32F0xx
46
 #ifdef STM32F0xx
47
-  #define HAL_TIMER_RATE (F_CPU)      // Frequency of timer peripherals
47
+  #define MCU_TIMER_RATE (F_CPU)      // Frequency of timer peripherals
48
   #define MCU_STEP_TIMER 16
48
   #define MCU_STEP_TIMER 16
49
   #define MCU_TEMP_TIMER 17
49
   #define MCU_TEMP_TIMER 17
50
 #elif defined(STM32F1xx)
50
 #elif defined(STM32F1xx)
51
-  #define HAL_TIMER_RATE (F_CPU)
51
+  #define MCU_TIMER_RATE (F_CPU)
52
   #define MCU_STEP_TIMER  4
52
   #define MCU_STEP_TIMER  4
53
   #define MCU_TEMP_TIMER  2
53
   #define MCU_TEMP_TIMER  2
54
 #elif defined(STM32F401xC) || defined(STM32F401xE)
54
 #elif defined(STM32F401xC) || defined(STM32F401xE)
55
-  #define HAL_TIMER_RATE (F_CPU / 2)
55
+  #define MCU_TIMER_RATE (F_CPU / 2)
56
   #define MCU_STEP_TIMER  9
56
   #define MCU_STEP_TIMER  9
57
   #define MCU_TEMP_TIMER 10
57
   #define MCU_TEMP_TIMER 10
58
 #elif defined(STM32F4xx) || defined(STM32F7xx)
58
 #elif defined(STM32F4xx) || defined(STM32F7xx)
59
-  #define HAL_TIMER_RATE (F_CPU / 2)
59
+  #define MCU_TIMER_RATE (F_CPU / 2)
60
   #define MCU_STEP_TIMER  6           // STM32F401 has no TIM6, TIM7, or TIM8
60
   #define MCU_STEP_TIMER  6           // STM32F401 has no TIM6, TIM7, or TIM8
61
   #define MCU_TEMP_TIMER 14           // TIM7 is consumed by Software Serial if used.
61
   #define MCU_TEMP_TIMER 14           // TIM7 is consumed by Software Serial if used.
62
 #endif
62
 #endif
63
 
63
 
64
+#ifndef HAL_TIMER_RATE
65
+  #define HAL_TIMER_RATE MCU_TIMER_RATE
66
+#endif
64
 #ifndef STEP_TIMER
67
 #ifndef STEP_TIMER
65
   #define STEP_TIMER MCU_STEP_TIMER
68
   #define STEP_TIMER MCU_STEP_TIMER
66
 #endif
69
 #endif

+ 1
- 0
Marlin/src/pins/stm32f4/pins_RUMBA32_common.h View File

47
 #define STEP_TIMER                          10
47
 #define STEP_TIMER                          10
48
 #define TEMP_TIMER                          14
48
 #define TEMP_TIMER                          14
49
 #define TIMER_SERIAL                        TIM9
49
 #define TIMER_SERIAL                        TIM9
50
+#define HAL_TIMER_RATE                      F_CPU
50
 
51
 
51
 //
52
 //
52
 // Limit Switches
53
 // Limit Switches

Loading…
Cancel
Save