This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

6678例子IPC_example_on_6678



大家好,在看这一个例子的中断配置部分时,我发现在调用了CSL_intcPlugEventHandler()函数后调用如下语句

/* clear the events. */

   if (CSL_intcHwControl(hintc[vector],CSL_INTC_CMD_EVTCLEAR, NULL) != CSL_SOK)

   {

       printf("Error: GEM-INTC CSL_INTC_CMD_EVTCLEAR command failed\n");

       return -1;

   }

/* Enabling the events. */

   if (CSL_intcHwControl(hintc[vector],CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)

   {

       printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failed\n");

       return -1;

   }

看注释应该是对事件进行清空和使能,请问这两步的意义是什么呢?谢谢大家了

  • 第一步,是在本次中断使能之前,清除以前可能已经发生但还没有被响应的中断,避免中断使能后的误响应;

    第二步,就是使能中断了,一旦新的中断到来就可以响应了。

    不知这样解释可以么~