ソースを参照

Fix STM401/4xx/STM32F7xx timers, STEVAL_3DP001V1 warning (#16621)

Bob Kuhn 4年前
コミット
1a5cbc9052

+ 29
- 5
Marlin/src/HAL/HAL_STM32/timers.h ファイルの表示

57
     #define TEMP_TIMER 2
57
     #define TEMP_TIMER 2
58
   #endif
58
   #endif
59
 
59
 
60
-#elif defined(STM32F4xx) || defined(STM32F7xx)
60
+#elif defined(STM32F401xC) || defined(STM32F401xE)
61
 
61
 
62
-  #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
62
+  #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
63
 
63
 
64
   // STM32F401 only has timers 1-5 & 9-11 with timers 4 & 5 usually assigned to TIMER_SERVO and TIMER_TONE
64
   // STM32F401 only has timers 1-5 & 9-11 with timers 4 & 5 usually assigned to TIMER_SERVO and TIMER_TONE
65
 
65
 
71
     #define TEMP_TIMER 10
71
     #define TEMP_TIMER 10
72
   #endif
72
   #endif
73
 
73
 
74
+#elif defined(STM32F4xx)
75
+
76
+  #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
77
+
78
+  #ifndef STEP_TIMER
79
+    #define STEP_TIMER 6
80
+  #endif
81
+
82
+  #ifndef TEMP_TIMER
83
+    #define TEMP_TIMER 14
84
+  #endif
85
+
86
+#elif defined(STM32F7xx)
87
+
88
+  #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
89
+
90
+  #ifndef STEP_TIMER
91
+    #define STEP_TIMER 6
92
+  #endif
93
+
94
+  #ifndef TEMP_TIMER
95
+    #define TEMP_TIMER 14
96
+  #endif
97
+
74
 #endif
98
 #endif
75
 
99
 
76
 #ifndef SWSERIAL_TIMER_IRQ_PRIO
100
 #ifndef SWSERIAL_TIMER_IRQ_PRIO
82
 #endif
106
 #endif
83
 
107
 
84
 #ifndef TEMP_TIMER_IRQ_PRIO
108
 #ifndef TEMP_TIMER_IRQ_PRIO
85
-  #define TEMP_TIMER_IRQ_PRIO 14 //14 = after hardware ISRs
109
+  #define TEMP_TIMER_IRQ_PRIO 14   // 14 = after hardware ISRs
86
 #endif
110
 #endif
87
 
111
 
88
 #define STEP_TIMER_NUM 0  // index of timer to use for stepper
112
 #define STEP_TIMER_NUM 0  // index of timer to use for stepper
89
 #define TEMP_TIMER_NUM 1  // index of timer to use for temperature
113
 #define TEMP_TIMER_NUM 1  // index of timer to use for temperature
90
 #define PULSE_TIMER_NUM STEP_TIMER_NUM
114
 #define PULSE_TIMER_NUM STEP_TIMER_NUM
91
 
115
 
92
-#define TEMP_TIMER_FREQUENCY 1000 //Temperature::isr() is expected to be called at around 1kHz
116
+#define TEMP_TIMER_FREQUENCY 1000   // Temperature::isr() is expected to be called at around 1kHz
93
 
117
 
94
-//TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
118
+// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
95
 #define STEPPER_TIMER_RATE 2000000 // 2 Mhz
119
 #define STEPPER_TIMER_RATE 2000000 // 2 Mhz
96
 #define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
120
 #define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
97
 #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
121
 #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs

+ 0
- 2
Marlin/src/pins/stm32/pins_STEVAL_3DP001V1.h ファイルの表示

48
   #define MACHINE_NAME "STEVAL-3DP001V1"
48
   #define MACHINE_NAME "STEVAL-3DP001V1"
49
 #endif
49
 #endif
50
 
50
 
51
-#define TIMER_TONE  5
52
-
53
 //
51
 //
54
 // Limit Switches
52
 // Limit Switches
55
 //
53
 //

+ 1
- 0
buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h ファイルの表示

200
 
200
 
201
 // Timer Definitions
201
 // Timer Definitions
202
 #define TIMER_SERVO             TIM4  // TIMER_SERVO must be defined in this file
202
 #define TIMER_SERVO             TIM4  // TIMER_SERVO must be defined in this file
203
+#define TIMER_TONE              TIM5  // TIMER_TONE must be defined in this file
203
 
204
 
204
 /* SD detect signal */
205
 /* SD detect signal */
205
 /*
206
 /*

読み込み中…
キャンセル
保存