IRLib2 on XIAO nRF52840 sense

Hello.
I am trying to use IRLib2 on a XIAO nRF52840 sense. I get, among others, the following compilation errors:
\Seeed_Arduino_IR\IRLibHardware.h:301:4: error: ‘TCCR2A’ was not declared in this scope
301 | TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21);
\Seeed_Arduino_IR\IRLibHardware.h:301:17: error: ‘WGM21’ was not declared in this scope
301 | TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21);
\Seeed_Arduino_IR\IRLibHardware.h:301:13: error: ‘_BV’ was not declared in this scope
301 | TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \

All the other errors are similar and related to things not declared in the scope. This code was working properly on an arduino M0 pro and the original IRLib2 library, I tried using the seeed_Arduino_IR library instead but it gives me the same errors. I’m not very knowledgeable but I’m guessing that some device-specific definitions are missing. Is there an easy way to use this library with the XIAO nRF52840 sense, ideally that does not require a high level of expertise?
Thanks.

Hi, So probably the difference is mbed vs. non mbed have you tried building with the other?
my. 02
HTH
GL :slight_smile:

Mbed being the nRF52840 sense?
The variables TCCR2A etc control PWM on Atmega chips.

On nRF52840 chips, PWM seems to be controlled by registers with different names.
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpwm.html
So I assume someone would need to add these registers to the IRLib2 library, but that would need to be someone more knowledgeable than me. I guess for my own goals it’ll be easier to to write a custom script not based on IRLib2.