ISR如何作为回调函数

ISR如何作为回调函数

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

问题描述

维基百科条目指出:

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如何作为回调函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 15:20