如何检查ISR的c代码是否正常?

时间:2014-04-02 05:13:55

标签: c interrupt qnx qnx-neutrino isr

 const struct sigevent *handler1(void *area, int id1)
 {
   volatile double KernelStartExecutionTime;
   KernelStartExecutionTime = GetTimeStamp();   // calculating the time when the kernel //starts executing
   measurements[18] = KernelStartExecutionTime ;
   return (NULL);
 }


 /*kernel calls attach the interrupt function handler to the hardware interrupt specified by intr(i.e irq) */
// InterruptAttach() : Attach an interrupt handler to an interrupt source
// interrupt source is handler1 for this example

void ISR(void)
{
  /*  the software must tell the OS that it wishes to associate the ISR with a particular source of interrupts.
  /*  On x86 platforms, there are generally 16 hardware Interrupt Request lines (IRQs) */
  volatile int irq = 0;   //0 : A clock that runs at the resolution set by ClockPeriod()



  ThreadCtl (_NTO_TCTL_IO, NULL);
  id1 = InterruptAttach(irq, &handler1, NULL, 0, 0);    // handler1 is the ISR

}

场景:客户端 - 服务器通信 - 客户端是发送者,服务器是接收者。当服务器在以太网接口(UDP)上接收数据时,服务器中的内核被触发。我在服务器端使用QNX。服务器(即嵌入式pc目标)正在处理中断以触发嵌入式pc目标(connining qnx)以引起注意执行新到达的数据。

我为内核创建了一个中断服务程序但是如何检查上面的代码是否正常工作。有人可以帮助我吗?

0 个答案:

没有答案