testisr.c
来自「很多嵌入式VxWorks的实验程序」· C语言 代码 · 共 36 行
C
36 行
/* testIsr.c it test the ISR for MPC860
* IRQ5 is the interrupt source
*/
#include "vxWorks.h"
#include "intLib.h"
#include "logLib.h"
#include "stdlib.h"
#include "stdio.h"
#include "iv.h"
#include "drv/intrctl/ppc860Intr.h"
#include "drv/multi/ppc860siu.h"
void TestIsr(void)
{
*SIPEND(vxImmrGet()) |=0x00200000;
/* SIU Interrupt Pending Register
note:
If an IRQ pin is defined as an edge interrupt (SIEL[EDn] = 1), the corresponding bit
being set indicates that a falling edge was detected on the line and are reset by
writing ones to them.*/
logMsg("Interrupt is OK \n",0,0,0,0,0,0);
}
void vx_main(void)
{
logMsg("This is ISR test program\n",0,0,0,0,0,0);
/*printf("this is ISR test program\n");*/
*SIEL(vxImmrGet()) |=0x00200000;
intConnect(IV_IRQ5, (VOIDFUNCPTR)TestIsr, 0);
intEnable(IV_IRQ5);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?