三:ARM公司設(shè)計(jì)NVIC:
some of the registers are saved onto the stack automatically 這段話表明了在處理中斷的時(shí)候,外了恢復(fù)中斷程序,ARM 公司把一些寄存器保存到堆棧中,在返回的時(shí)候自動(dòng)恢復(fù),
when an exception is accepted, and are also automatically restored in an exception
return sequence. This mechanism allows the exception handlers to be written as
normal C functions without any additional software overhead.
Set up the priority level of the required interrupt (this step is optional)
• Enable the interrupt generation control in the peripheral that triggers the interrupt
• Enable the interrupt in the NVIC
這段話告訴我們:當(dāng)要使用中斷的時(shí)候,第一步:使用外部中斷的使能(就好比開時(shí)鐘一樣);第二步:設(shè)置中斷的優(yōu)先級(jí)級(jí)別;第3步:?jiǎn)⒂肗VIC的中斷。