Interrupts() and noInterrupts() is undefined

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()
Expands to:
__enable_irq()
identifier “__enable_irq” is undefined

#define noInterrupts() __disable_irq()
Expands to:
__disable_irq()
identifier “__disable_irq” is undefined

\Arduino15\packages\Seeeduino\hardware\samd\1.7.9\cores\arduino\Arduino.h
142: #define interrupts() __enable_irq()

\Arduino15\packages\Seeeduino\tools\CMSIS\5.4.0\CMSIS\Core\Include\cmsis_iccarm.h
554: #define __enable_irq __enable_interrupt

No definition found for ‘__enable_interrupt’

Any ideas?

1 Like

Does the XIOA even support Hardware Timer Interrupts?
TCCR1A = 0;
TCCR1A = _BV(WGM10);
TCCR1B = 0;
TCCR1B = _BV(CS10) | _BV(WGM12);
TIMSK1 |= _BV(TOIE1);
tells me
error: ‘TCCR1A’ was not declared in this scope

1 Like

https://gist.github.com/nonsintetic/ad13e70f164801325f5f552f84306d6f @Ascii Does this code help you?

1 Like

@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.

1 Like

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.