Ada中断处理程序

Leo*_*eon 4 ada interrupt-handling

当使用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);
Run Code Online (Sandbox Code Playgroud)

假设这一切都正确并且我已经在寄存器中启用了中断,那么我还需要添加其他与中断相关的代码吗?特别是,我是否需要直接与寄存器交互以某种方式"链接"我的处理程序代码,或者我可以只设置寄存器的记录表示,直接输出必要的设置,然后让rip?

谢谢!

Mar*_*c C 6

我认为你是在正确的轨道上,但如果你以前没有这样做,我会,如果我是你,我会回顾一些关于Ada中断处理的文章.例如: