I’m trying to compile https://github.com/midilab/uClock for the XIAO but I’m getting errors on the interrupts calls:
#define interrupts() __enable_irq()
identifier “__enable_irq” is undefined
#define noInterrupts() __disable_irq()
identifier “__disable_irq” is undefined
142: #define interrupts() __enable_irq()
554: #define __enable_irq __enable_interrupt
No definition found for ‘__enable_interrupt’
Does the XIOA even support Hardware Timer Interrupts?
TCCR1A = 0;
TCCR1A = _BV(WGM10);
TCCR1B = 0;
TCCR1B = _BV(CS10) | _BV(WGM12);
TIMSK1 |= _BV(TOIE1);
error: ‘TCCR1A’ was not declared in this scope
@Ascii were you ever able to get uClock working on the XIAO ? There have been several updates to uClock since your post here. I’d like to implement uClock on a XIAO for a midi project I am working on too. I have also reached out to the developer of uClock on GitHub regarding XIAO support. They are willing to port but need more information: uClock support for Seeeduino XIAO? · Issue #6 · midilab/uClock · GitHub
the framework-arduino-samd-seeed package delivers a TimerTCC0.h you need to include. Otherwise there was some rewriting necessary I can’t remember right away. But at the end it was working.
There was something with adding a new initSAMDTimer I remember, where TimerTcc0 was initialized and attached to an ISR.
However, there is a new version of uClock available which I haven’t been able to verify.
Ok, thanks so much for the detail and glad you got it working. The developer of uClock is willing to write a XIAO specific port of the library and I am sure would appreciate any input. Thanks again.