中断服务程序不用interrupt关键字也可实现中断,该关键字是否必须?
2013-06-20 11:13:35
中断服务程序不用interrupt关键字也可实现中断,该关键字是否必须?
使用tools->pin connect,将INT5与pin.txt关联,模拟外部中断,主函数如下:
1 #include <stdio.h> 2 #include <gbl.h> 3 #include "pin_connect_cfg.h" 4 5 int main() 6 { 7 C64_enableIER(1<<5); 8 } 9 10 interrupt void HWI_int5_isr() 11 //void HWI_int5_isr() 12 { 13 printf("HWI int5 happen! "); 14 }
中断服务程序加不加interrupt关键字,都可正常输出:
HWI int5 happen!
HWI int5 happen!
HWI int5 happen!
HWI int5 happen!
HWI int5 happen!
HWI int5 happen!
但文章http://www.cnblogs.com/youngforever/articles/3147153.html所述:
在使用HWI对象时,若其中断处理函数使用C语言来编写则一定不能使用interrupt关键字或INTERRUPT pragma,因为HWI对象调用的函数已经包含了这些功能。
是不是通过DSP/BIOS配置的HWI是不能使用interrupt关键字的?
难道上面的因为是simulator,不能反映实际问题?