I have a level 5 interrupt handler that replaces the weak casting of the xt_highint5 interrupt handler That works perfectly, but now I need to be able to change this handler on the fly, not just at compile time. From looking at the low level includes, it seems that there is a function in the ROM that you can call to change the interrupt handler:
xt_set interrupt handler
I have not been able to get this to compile:
Code: Select all
xt_set_interrupt_handler(INTR_NUM, &new_xt_highint5, NULL);
No matter how I format this (using & or * or nothing with the handler name), I get the same compiler error:
Code: Select all
Compilation error: invalid conversion from 'void (*)()' to 'xt_handler' {aka 'void (*)(void*)'} [-fpermissive]
The interrupt code is located in a .S (assembly) file. I have tried every version of 'extern' that I can think of to make sure there is an association.
Does anyone know how to make this compile? I am using the Arduino v2.0.17 core (because v3.x core breaks many things I have to use).
Thanks!