⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testisr.c

📁 很多嵌入式VxWorks的实验程序
💻 C
字号:
/* 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -