I would like to use Timer.2 CPU interrupt. It is priority level 5 interrupt (not C servicable).
I am initializating it like this:
Code: Select all
void System_Time_Init()
{
uint32_t ccount;
__asm__ __volatile__ ("rsr.ccount %0" : "=r"(ccount));
ccount += 10000;
__asm__ __volatile__ ("wsr.ccompare2 %0" :: "r"(ccount));
uint32_t intenable;
__asm__ __volatile__ ("rsr.intenable %0" : "=r"(intenable));
intenable |= 1u << 16u;
__asm__ __volatile__ ("wsr.intenable %0" :: "r"(intenable));
}
Code: Select all
rsr.interrupt a0