ISR如何作为回调函数 [英] How is ISR a callback function

查看:161
本文介绍了ISR如何作为回调函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

维基百科条目指出:

在计算机系统编程中,中断处理程序(也称为中断服务程序或ISR)是微控制器固件,操作系统或设备驱动程序中的回调函数,其执行是通过接收中断来触发的. /p>

In computer system programming, an interrupt handler, also known as an interrupt service routine or ISR, is a callback function in microcontroller firmware, an operating system or a device driver, whose execution is triggered by the reception of an interrupt.

ISR如何回调.堆栈中存储的PC值本身就是回调函数吗?

How is ISR a callback. Is it the PC value stored on stack itself is the callback function?

也就是说,ISR会回调被中断的函数.因此,中断的函数是回调.

I.e., the ISR calls the interrupted function back. Hence the interrupted function is a callback.

推荐答案

一些设置代码将ISR函数的地址存储在中断向量表中,在该地址说"给我回电"当中断发生时".

A bit of setup code stores the address of the ISR function in the interrupt vector table to say "call me back at this address when the interrupt occurs".

需要明确的是,ISR本身就是被调用"的功能.中断的代码不是回调.它只是中断",后来恢复".

To be clear, the ISR itself is the function that is "called back". The interrupted code is not the callback; it is merely "interrupted" and later "resumed".

这篇关于ISR如何作为回调函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆