小编Leo*_*eon的帖子

Ada中断处理程序

当使用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?

谢谢!

ada interrupt-handling

4
推荐指数
1
解决办法
996
查看次数

标签 统计

ada ×1

interrupt-handling ×1