10
10
#pragma message("")
11
11
12
12
13
- // #define SIMPLEFOC_STM32_DEBUG
14
-
15
13
#ifdef SIMPLEFOC_STM32_DEBUG
16
14
void printTimerCombination (int numPins, PinMap* timers[], int score);
17
15
int getTimerNumber (int timerIndex);
@@ -210,28 +208,28 @@ void _stopTimers(HardwareTimer **timers_to_stop, int timer_num)
210
208
// returns -1 if no trigger source is found
211
209
// currently supports the master timers to be from TIM1 to TIM8
212
210
int _getTriggerSourceRegister (HardwareTimer* timer) {
213
- #if defined(TIM1) && TIM_TS_ITR0
211
+ #if defined(TIM1) && defined(LL_TIM_TS_ITR0)
214
212
if (timer->getHandle ()->Instance == TIM1) return LL_TIM_TS_ITR0;// return TIM_TS_ITR0;
215
213
#endif
216
- #if defined(TIM2) && TIM_TS_ITR1
214
+ #if defined(TIM2) && defined(LL_TIM_TS_ITR1)
217
215
if (timer->getHandle ()->Instance == TIM2) return LL_TIM_TS_ITR1;// return TIM_TS_ITR1;
218
216
#endif
219
- #if defined(TIM3) && TIM_TS_ITR2
217
+ #if defined(TIM3) && defined(LL_TIM_TS_ITR2)
220
218
if (timer->getHandle ()->Instance == TIM3) return LL_TIM_TS_ITR2;// return TIM_TS_ITR2;
221
219
#endif
222
- #if defined(TIM4) && TIM_TS_ITR3
220
+ #if defined(TIM4) && defined(LL_TIM_TS_ITR3)
223
221
if (timer->getHandle ()->Instance == TIM4) return LL_TIM_TS_ITR3;// return TIM_TS_ITR3;
224
222
#endif
225
- #if defined(TIM5) && TIM_TS_ITR4
223
+ #if defined(TIM5) && defined(LL_TIM_TS_ITR4)
226
224
if (timer->getHandle ()->Instance == TIM5) return LL_TIM_TS_ITR4;// return TIM_TS_ITR4;
227
225
#endif
228
- #if defined(TIM6) && TIM_TS_ITR5
226
+ #if defined(TIM6) && defined(LL_TIM_TS_ITR5)
229
227
if (timer->getHandle ()->Instance == TIM6) return LL_TIM_TS_ITR5;// return TIM_TS_ITR5;
230
228
#endif
231
- #if defined(TIM7) && TIM_TS_ITR6
229
+ #if defined(TIM7) && defined(LL_TIM_TS_ITR6)
232
230
if (timer->getHandle ()->Instance == TIM7) return LL_TIM_TS_ITR6;// return TIM_TS_ITR6;
233
231
#endif
234
- #if defined(TIM8) && TIM_TS_ITR7
232
+ #if defined(TIM8) && defined(LL_TIM_TS_ITR7)
235
233
if (timer->getHandle ()->Instance == TIM8) return LL_TIM_TS_ITR7;// return TIM_TS_ITR7;
236
234
#endif
237
235
return -1 ;
@@ -256,9 +254,9 @@ void _alignTimersNew() {
256
254
timers[numTimers++] = timer;
257
255
}
258
256
259
- #ifdef SIMPLEFOC_STM32_DEBUG
260
- SIMPLEFOC_DEBUG (" STM32-DRV: Syncronising timers!\n Timer no. " , numTimers);
261
- #endif
257
+ #ifdef SIMPLEFOC_STM32_DEBUG
258
+ SIMPLEFOC_DEBUG (" STM32-DRV: Syncronising timers! Timer no. " , numTimers);
259
+ #endif
262
260
263
261
// see if there is more then 1 timers used for the pwm
264
262
// if yes, try to align timers
0 commit comments