timer setup changes for non avr

pull/9/head
midilab 3 years ago
parent 7faa14d8d4
commit d39de549cc
  1. 32
      src/uClock.cpp

@ -66,25 +66,23 @@ void uclockInitTimer()
{ {
// begin at 120bpm (20833us) // begin at 120bpm (20833us)
const uint16_t init_clock = 20833; const uint16_t init_clock = 20833;
ATOMIC( #if defined(TEENSYDUINO)
#if defined(TEENSYDUINO) _uclockTimer.begin(uclockISR, init_clock);
_uclockTimer.begin(uclockISR, init_clock);
// Set the interrupt priority level, controlling which other interrupts
// Set the interrupt priority level, controlling which other interrupts // this timer is allowed to interrupt. Lower numbers are higher priority,
// this timer is allowed to interrupt. Lower numbers are higher priority, // with 0 the highest and 255 the lowest. Most other interrupts default to 128.
// with 0 the highest and 255 the lowest. Most other interrupts default to 128. // As a general guideline, interrupt routines that run longer should be given
// As a general guideline, interrupt routines that run longer should be given // lower priority (higher numerical values).
// lower priority (higher numerical values). _uclockTimer.priority(0);
_uclockTimer.priority(0); #endif
#endif
#if defined(SEEED_XIAO_M0) #if defined(SEEED_XIAO_M0)
_uclockTimer.initialize(init_clock); _uclockTimer.initialize(init_clock);
// attach to generic uclock ISR // attach to generic uclock ISR
_uclockTimer.attachInterrupt(uclockISR); _uclockTimer.attachInterrupt(uclockISR);
#endif #endif
)
} }
#endif #endif

Loading…
Cancel
Save