Tag: isr

在32位Open Watcom C中生成FAR跳转指令

我需要生成一个远跳指令来跳转到另一个ISR(中断服务程序)。 我正在开发一个32位FreeDOS应用程序。 在阅读了OW手册( cguide.pdf和clr.pdf )之后,我想出了两种无需 任何警告或错误即可成功编译的方法。 /* Code Snippet #1 */ #pragma aux old08 aborts ; void (__interrupt __far *old08)(void); // function pointer declaration void __interrupt __far new08(void) { /* Do some processing here … */ (*old08)(); /* OW will now generate a jump inst. instead of call*/ } 我想出的另一种方法是: /* Code Snippet #2 */ […]

是否可以在运行时在M0 +上设置ISR处理程序

我的SAMD21 ARM M0 +有一个“默认”resetVectors.c文件。 它有一些看起来像: __attribute__ ((section(“.vectors”))) const DeviceVectors exception_table = { … }; 在其中定义不同的处理程序存根的位置。 出于测试目的,我想使用其中一个未使用的外设IRQ。 默认情况下,未使用的设置为NULL地址。 我已向自己certificate我可以修改该文件,并在编译时更改我未使用的IRQ(21)以触发处理程序。 但是,是否可以在编译时间之外完成此操作? 我观察到该表似乎是基于偏移0.所以我尝试了这个: DeviceVectors *table = 0x0000000; table->pvReserved21 = PV21Handler; 但这只是挂板。 是否有动态方式在运行时分配处理程序?