在使用Ada中断处理程序时,到目前为止,我已经在代码中隔离了一些需要它们工作的特定内容。
使用Ada.Interrupts:
protected Int_Handler is --a protected object to handle interrupts
procedure Handler_1; --A procedure which handles interrupts from your first device (with a body, of course)
pragma Interrupt_Handler (Handler_1); --To tell the compiler this is an interrupt handler
--Later in the program:
begin
Attach_Handler (Int_Handler.Handler_1'access, Serial_1);假设这一切都是正确的,并且我已经在寄存器中启用了中断,那么我还需要添加其他与中断相关的代码吗?特别是,我是否需要直接与寄存器交互,以某种方式“链接”我的处理程序代码,或者我是否可以设置寄存器的记录表示,直接输出到它们所需的设置,然后让rip?
谢谢!
发布于 2012-05-17 17:50:32
我认为你在正确的轨道上,但如果你以前没有这样做,我会,如果我是你,回顾一些文章已经发表了中断处理与Ada。例如:
https://stackoverflow.com/questions/10640108
复制相似问题