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.

关于中断服务函数如何响应?



在CCS6.2的帮助中,发现如下中断配置例程:

An example of using CpIntc during runtime to plug the ISR handler for System interrupt 15 mapped to Host interrupt 8 on Hwi 7.
  Int eventId;
  Hwi_Params params;
  Error_Block eb;

  // Initialize the error block
  Error_init(&eb);

  // Map system interrupt 15 to host interrupt 8 on Intc 0
  CpIntc_mapSysIntToHostInt(0, 15, 8);

  // Plug the function and argument for System interrupt 15 then enable it
  CpIntc_dispatchPlug(15, &myEvent15Fxn, 15, TRUE);

  // Enable Host interrupt 8 on Intc 0
  CpIntc_enableHostInt(0, 8);

  // Get the eventId associated with Host interrupt 8
  eventId = CpIntc_getEventId(8);

  // Initialize the Hwi parameters
  Hwi_Params_init(&params);

  // Set the eventId associated with the Host Interrupt
  params.eventId = eventId;

  // The arg must be set to the Host interrupt
  params.arg = 8;

  // Enable the interrupt vector
  params.enableInt = TRUE;

  // Create the Hwi on interrupt 7 then specify 'CpIntc_dispatch'
  // as the function.
  Hwi_create(7, &CpIntc_dispatch, &params, &eb);

这里 myEvent15Fxn 为自定义函数,CpIntc_dispatch 为内部函数,当系统中断事件发生时,应该会执行myEvent15Fxn,
那么将 Host interrupt 再关连到硬件中断7的作用是什么,如果不关连就是不会执行 myEvent15Fxn吗?
既然已经指定中断服务函数 myEvent15Fxn,CpIntc_dispatch作用是什么?