📄 sys_irq.c
字号:
//====================================================================================
//File Name: Sys_IRQ.c
//Description: Dispatch 40 hardware interrupt sources of SPCE3200;
// Handle software interrupts.
// Note that this file needn't be modified in your application.
//Update: 2007.01.11 V1.0 by hongyan.Feng
//====================================================================================
//=====================================================================================
//Declare the external interrupt service routines user defined
//=====================================================================================
extern void IRQ63(void);
extern void IRQ62(void);
extern void IRQ61(void);
extern void IRQ60(void);
extern void IRQ59(void);
extern void IRQ58(void);
extern void IRQ57(void);
extern void IRQ56(void);
extern void IRQ55(void);
extern void IRQ54(void);
extern void IRQ53(void);
extern void IRQ52(void);
extern void IRQ51(void);
extern void IRQ50(void);
extern void IRQ49(void);
extern void IRQ48(void);
extern void IRQ47(void);
extern void IRQ46(void);
extern void IRQ45(void);
extern void IRQ44(void);
extern void IRQ43(void);
extern void IRQ42(void);
extern void IRQ41(void);
extern void IRQ40(void);
extern void IRQ39(void);
extern void IRQ38(void);
extern void IRQ37(void);
extern void IRQ36(void);
extern void IRQ35(void);
extern void IRQ34(void);
extern void IRQ33(void);
extern void IRQ32(void);
extern void IRQ31(void);
extern void IRQ30(void);
extern void IRQ29(void);
extern void IRQ28(void);
extern void IRQ27(void);
extern void IRQ26(void);
extern void IRQ25(void);
extern void IRQ24(void);
//====================================================
// Prototype: void intmsg(void)
// Description: Handler for software interrupts and the hardware interrupts
// of S+core processor, except 40 hardware interrupts of SPCE3200.
// Input Arguments: None
// Output Arguments: None
//====================================================
void intmsg(void)
{
while(1);
}
//====================================================
// Prototype: void irq_dispatch(unsigned int cp0_cause)
// Description: Get interrupt vector number of one of 40 SPCE3200 hardware
// interrupts, then call related service routine according to
// the number.
// Input Arguments: cp0_cause - value in S+core processor register 'cr2'.
// Where, bit[23:18] is the interrupt vector
// number of one of 63 hardware interrupts.
// Output Arguments: None
//====================================================
void irq_dispatch(unsigned int cp0_cause)
{
int intvec=0;
intvec = (cp0_cause & 0x00FC0000)>>18;
//Get interrupt vector number
switch (intvec)
{
case 63: //DAC interrupt
IRQ63();
break;
case 62: //Reserved
IRQ62();
break;
case 61: //Reserved
IRQ61();
break;
case 60: //Reserved
IRQ60();
break;
case 59: //MIC overflow interrupt
IRQ59();
break;
case 58: //ADC interrupt
IRQ58();
break;
case 57: //TMB interrupt
IRQ57();
break;
case 56:
IRQ56(); //Timer interrupt
break;
case 55:
IRQ55(); //TV vblanking start interrupt
break;
case 54:
IRQ54(); //LCD vblanking start interrupt
break;
case 53:
IRQ53(); //Reserved
break;
case 52: //Light Gun interrupt
IRQ52();
break;
case 51: //CSI frame end interrupt
IRQ51();
break;
case 50: //CSI coordinate hit interrupt
IRQ50();
break;
case 49: //CSI motion frame end interrupt
IRQ49();
break;
case 48: //CSI capture done interrupt
IRQ48();
break;
case 47: //TV coordinate hit interrupt
IRQ47();
break;
case 46: //Reserved
IRQ46();
break;
case 45: //USB host+device interrupt
IRQ45();
break;
case 44: //SIO interrupt
IRQ44();
break;
case 43: //SPI interrupt
IRQ43();
break;
case 42: //UART interrupt
IRQ42();
break;
case 41: //Nand interrupt
IRQ41();
break;
case 40: //SD interrupt
IRQ40();
break;
case 39: //I2C interrupt
IRQ39();
break;
case 38: //I2S interrupt
IRQ38();
break;
case 37: //APBDMA CH1 interrupt
IRQ37();
break;
case 36: //APBDMA CH2 interrupt
IRQ36();
break;
case 35: //LDM DMA interrupt
IRQ35();
break;
case 34: //BIN DMA interrupt
IRQ34();
break;
case 33: //APBDMA CH3 interrupt
IRQ33();
break;
case 32: //APBDMA CH4 interrupt
IRQ32();
break;
case 31: //RTC interrupt
IRQ31();
break;
case 30: //MP4 interrupt
IRQ30();
break;
case 29: //C3--ECC Module interrupt
IRQ29();
break;
case 28: //GPIO interrupt
IRQ28();
break;
case 27: //BUFCTL and TVvblanking end interrupt
IRQ27();
break;
case 26: //Reserved
IRQ26();
break;
case 25: //Reserved
IRQ25();
break;
case 24: //Reserved
IRQ24();
break;
default:
break;
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -