Skip to content

Commit adbc55a

Browse files
committed
bugfix forgotten define check for TRGO events
1 parent ce7a032 commit adbc55a

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/drivers/hardware_specific/stm32/stm32_mcu.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#pragma message("")
1111

1212

13-
//#define SIMPLEFOC_STM32_DEBUG
14-
1513
#ifdef SIMPLEFOC_STM32_DEBUG
1614
void printTimerCombination(int numPins, PinMap* timers[], int score);
1715
int getTimerNumber(int timerIndex);
@@ -210,28 +208,28 @@ void _stopTimers(HardwareTimer **timers_to_stop, int timer_num)
210208
// returns -1 if no trigger source is found
211209
// currently supports the master timers to be from TIM1 to TIM8
212210
int _getTriggerSourceRegister(HardwareTimer* timer) {
213-
#if defined(TIM1) && TIM_TS_ITR0
211+
#if defined(TIM1) && defined(LL_TIM_TS_ITR0)
214212
if (timer->getHandle()->Instance == TIM1) return LL_TIM_TS_ITR0;// return TIM_TS_ITR0;
215213
#endif
216-
#if defined(TIM2) && TIM_TS_ITR1
214+
#if defined(TIM2) && defined(LL_TIM_TS_ITR1)
217215
if (timer->getHandle()->Instance == TIM2) return LL_TIM_TS_ITR1;//return TIM_TS_ITR1;
218216
#endif
219-
#if defined(TIM3) && TIM_TS_ITR2
217+
#if defined(TIM3) && defined(LL_TIM_TS_ITR2)
220218
if (timer->getHandle()->Instance == TIM3) return LL_TIM_TS_ITR2;//return TIM_TS_ITR2;
221219
#endif
222-
#if defined(TIM4) && TIM_TS_ITR3
220+
#if defined(TIM4) && defined(LL_TIM_TS_ITR3)
223221
if (timer->getHandle()->Instance == TIM4) return LL_TIM_TS_ITR3;//return TIM_TS_ITR3;
224222
#endif
225-
#if defined(TIM5) && TIM_TS_ITR4
223+
#if defined(TIM5) && defined(LL_TIM_TS_ITR4)
226224
if (timer->getHandle()->Instance == TIM5) return LL_TIM_TS_ITR4;//return TIM_TS_ITR4;
227225
#endif
228-
#if defined(TIM6) && TIM_TS_ITR5
226+
#if defined(TIM6) && defined(LL_TIM_TS_ITR5)
229227
if (timer->getHandle()->Instance == TIM6) return LL_TIM_TS_ITR5;//return TIM_TS_ITR5;
230228
#endif
231-
#if defined(TIM7) && TIM_TS_ITR6
229+
#if defined(TIM7) && defined(LL_TIM_TS_ITR6)
232230
if (timer->getHandle()->Instance == TIM7) return LL_TIM_TS_ITR6;//return TIM_TS_ITR6;
233231
#endif
234-
#if defined(TIM8) && TIM_TS_ITR7
232+
#if defined(TIM8) && defined(LL_TIM_TS_ITR7)
235233
if (timer->getHandle()->Instance == TIM8) return LL_TIM_TS_ITR7;// return TIM_TS_ITR7;
236234
#endif
237235
return -1;
@@ -256,9 +254,9 @@ void _alignTimersNew() {
256254
timers[numTimers++] = timer;
257255
}
258256

259-
#ifdef SIMPLEFOC_STM32_DEBUG
260-
SIMPLEFOC_DEBUG("STM32-DRV: Syncronising timers!\nTimer no. ", numTimers);
261-
#endif
257+
#ifdef SIMPLEFOC_STM32_DEBUG
258+
SIMPLEFOC_DEBUG("STM32-DRV: Syncronising timers! Timer no. ", numTimers);
259+
#endif
262260

263261
// see if there is more then 1 timers used for the pwm
264262
// if yes, try to align timers

0 commit comments

Comments
 (0)