?? irq.inc
字號:
.include hardware.inc // include io information
.external F_Key_Scan;
.code
.public _Initirq5
_Initirq5:
int off
call ClearWatchDog;
r1=0x0008 //開中斷IRQ5_4Hz和IRQ5_2Hz
[P_INT_CTRL]=r1
[P_INT_CTRL_NEW]=r1
R1=0
int irq
retf;
.TEXT
.public _BREAK;
.public _FIQ;
.public _IRQ0;
.public _IRQ1;
.public _IRQ2;
.public _IRQ3;
.public _IRQ4;
.public _IRQ5;
.public _IRQ6;
.public _IRQ7;
_FIQ:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
/////////////////////////////////////////////////////////////////////////////////////////
// Function: Interrupt Service routine Area
// Service for IRQ1 - IRQ7
// User's IRQ must hook on here
/////////////////////////////////////////////////////////////////////////////////////////
_BREAK:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
_IRQ0:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
_IRQ1:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
_IRQ2:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
_IRQ3:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
/////////////////////////////////////////
_IRQ4:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
L_IRQ4_2KHz:
[P_INT_Clear] = r1;
pop r1,r4 from [sp];
reti;
L_IRQ4_1KHz:
[P_INT_Clear] = r1;
pop r1,r4 from [sp];
reti;
////////////////////////////////////////
_IRQ5:
push r1,r5 to [sp] //壓棧保護
r1=0x0008
test r1,[P_INT_CTRL] //比較是否為4Hz的中斷源
jnz l_irq5_4 //是,則轉至對應程序段
l_irq5_2: //否,則進入2Hz程序段
r1=0x0004
[P_INT_CLEAR]=r1
pop r1,r5 from [sp]
RETI
l_irq5_4:
r1=0x0008
[P_INT_CLEAR]=r1
R1 = 0x0001
[0x7012] = R1
pop r1,r5 from [sp]
RETI
//////////////////////////////////////////////////////
_IRQ6:
push r1,r4 to [sp];
r1=0x0001;
test r1,[P_INT_Ctrl];
jnz _IRQ6_TMB2;
r1=0x0002;
[P_INT_Clear]=r1;
pop r1,r4 from [sp];
reti;
_IRQ6_TMB2:
[P_INT_Clear]=r1;
pop r1,r4 from [sp];
reti;
//////////////////////////////////////////////////////
_IRQ7:
push r1,r4 to [sp];
pop r1,r4 from [sp];
reti;
//========================================================================================
// End of isr.asm
//========================================================================================
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -