你问的是HCS12 CORE的中断还是XGATE的中断? 实际上使用codewarrior新建一个工程,或者参考demo工程就可以了. static void SetupXGATE(void) { /* initialize the XGATE vector block and set the XGVBR register to its start address */ XGVBR= (unsigned int)(void*__far)(XGATE_VectorTable - XGATE_VECTOR_OFFSET);
/* switch software trigger 0 interrupt to XGATE */ ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, 0x81); /* RQST=1 and PRIO=1 */
/* enable XGATE mode and interrupts */ XGMCTL= 0xFBC1; /* XGE | XGFRZ | XGIE */
/* force execution of software trigger 0 handler */ XGSWT= 0x0101; } const XGATE_TableEntry XGATE_VectorTable[] = { // Channel # = Vector address / 2 /* channel 0..8 are not used, first used must match macro XGATE_VECTOR_OFFSET in xgate.h */ {ErrorHandler, 0x09}, // Channel 09 - Reserved {ErrorHandler, 0x0A}, // Channel 0A - Reserved {ErrorHandler, 0x0B}, // Channel 0B - Reserved {ErrorHandler, 0x0C}, // Channel 0C - Reserved {ErrorHandler, 0x0D}, // Channel 0D - Reserved {ErrorHandler, 0x0E}, // Channel 0E - Reserved ...... }; |