force the use of defined object TimerTcc0 to avoid problems with xiao mcu

pull/19/head v1.1.4
midilab 2 years ago
parent c897802fb3
commit 45bf1eaed1
  1. 10
      src/uClock.cpp

@ -39,10 +39,10 @@ IntervalTimer _uclockTimer;
#if defined(SEEED_XIAO_M0) #if defined(SEEED_XIAO_M0)
// 24 bits timer // 24 bits timer
#include <TimerTCC0.h> #include <TimerTCC0.h>
#define _uclockTimer TimerTcc0 // uses TimerTcc0
// 16 bits timer // 16 bits timer
//#include <TimerTC3.h> //#include <TimerTC3.h>
//#define _uclockTimer TimerTc3 // uses TimerTc3
#endif #endif
#if defined(ARDUINO_ARCH_AVR) #if defined(ARDUINO_ARCH_AVR)
@ -82,10 +82,10 @@ void uclockInitTimer()
#endif #endif
#if defined(SEEED_XIAO_M0) #if defined(SEEED_XIAO_M0)
_uclockTimer.initialize(init_clock); TimerTcc0.initialize(init_clock);
// attach to generic uclock ISR // attach to generic uclock ISR
_uclockTimer.attachInterrupt(uclockISR); TimerTcc0.attachInterrupt(uclockISR);
#endif #endif
} }
#endif #endif
@ -211,7 +211,7 @@ void uClockClass::setTimerTempo(float bpm)
#endif #endif
#if defined(SEEED_XIAO_M0) #if defined(SEEED_XIAO_M0)
_uclockTimer.setPeriod(tick_us_interval); TimerTcc0.setPeriod(tick_us_interval);
#endif #endif
#endif #endif
} }

Loading…
Cancel
Save