正如我们所知,我们编写Embedded C
程序是为了task management, memory management, ISR, File system
一切。
我想知道如果一些task or process is running
和同时是一个interrupt occurred
,那么how SW or process or system comes to know that, the interrupt has occurred?
和 pauses
当前的task execution
和starts serving ISR
。
假设我会写下面的代码:
// Dummy Code
void main()
{
for(;;)
printf("\n forever");
}
// Dummy code for ISR for understanding
void ISR()
{
printf("\n Interrupt occurred");
}
在上面的代码中,如果一个external interrupt(ISR) occurs
,那么如何main()
知道中断发生了?所以它会首先开始为 ISR 服务?