Codewarrior project wizard generates code, in which you can find ROUTE_INTERRUPT macro:
#define ROUTE_INTERRUPT(vec_adr, cfdata) \
INT_CFADDR= (vec_adr) & 0xF0; \
INT_CFDATA_ARR[((vec_adr) & 0x0F) >> 1]= (cfdata)
Where vec_adr argument is vector number and cfdata is interrupt routing and priority level.
For example
#define SOFTWARETRIGGER0_VEC 0x72 /* vector address= 2 * channel id */
This would route software trigger interrupt to XGATE (bit7 of cfdata is set):
ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, 0x81); /* RQST=1 and PRIO=1 */
This would route software trigger interrupt to S12X (bit7 of cfdata is cleared) and set interrupt priority to prio:
ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, (prio & 0x7));
I wonder why do you want to change interrupt priority? Is some of your ISR handler long to execute? I think CAN interrupt should execute longer, it's more complicated, isn't it? If CAN ISR takes longer, than I would make it lower priority and reenable interrupts in CAN ISR, allowing this way higher priority to interrupt lower priority and longer to execute CAN ISR.
Message Edited by kef on
2007-12-13 09:27 AM