標(biāo)題: lpc2103 定義空函數(shù)的問題 [打印本頁]

作者: 51黑tt    時間: 2016-3-6 13:23
標(biāo)題: lpc2103 定義空函數(shù)的問題
#pragma vector=IRQV
__irq __arm void gh ( )
{
void (*interrupt_function)();

  interrupt_function = (void(*)())VICVectAddr;
    interrupt_function();   
}
這個是中斷服務(wù)程序,請問其中的void (*interrupt_function)();是什么意思?



最佳答案

void(*interrupt_function)()定義一函數(shù)指針,指向一無參數(shù),無返回值的函數(shù).
interrupt_function=(void(*)())VICVectAddr.此處將VICVectAddr進行強制類型轉(zhuǎn)換后賦給interrupt_function.

interrupt_function();//調(diào)用此函數(shù).






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1