问个VxWorks中断的问题
我在Tornado2.2的usrAppInit函数里,使用intConnect连接一个ISR,怎么老是不成功?!
是一个外部中断
intConnect((VOIDFUNCPTR *)0x08,(VOIDFUNCPTR)ISR1,0);
就这样,应该可以吧。
ISR1里就一个logMsg;
我的处理器是POWERPC的MPC860。
[解决办法]
给个实际的代码给你参考下:
m8260IntDisable(INUM_IRQ4);
/* connect gpio interrupts */
(void) intConnect (INUM_TO_IVEC(INUM_IRQ4),(VOIDFUNCPTR)IRQ_REMOTE_ISR, 0);
m8260IntEnable(INUM_IRQ4);
static void IRQ_REMOTE_ISR(void)
{
unsigned char RemoteData;
unsigned long msg_buf[4];
memset(msg_buf,0,sizeof(msg_buf));
RemoteData =(*(unsigned char *)HD_FPGA_REMOTE_DATA1_REG);
msg_buf[0] = (unsigned long)RemoteData;
q_send(g_q_remote,msg_buf);
*((volatile unsigned long *)0xf0010c08) |= 0x800;//一定要清中断
}