目前使用STM32+CH432,可以收發(fā),但在設(shè)置INT#中斷為外部輸入中斷后,即使兩個串口有信息回復(fù),也無法觸發(fā)INT#中斷,如果把void CH432Interrupt(void)?函數(shù)放在進(jìn)程中輪詢,INT#中斷才會觸發(fā),但是正常流程應(yīng)該是把CH432Interrupt(void)函數(shù)放在INT#中斷服務(wù)函數(shù)里執(zhí)行,請問可能是什么原因?
配置如下:
???UINT16?div; ????UINT8?DLL,?DLM; /************************************************************************** ??????????設(shè)置CH432串口0的寄存器 **************************************************************************/ ????div?=?(?Fpclk?>>?4?)?/?CH432_BPS0; ????DLM?=?div?>>?8; ????DLL?=?div?&?0xff; ????WriteCH432Data(?CH432_IER_PORT,?BIT_IER_RESET);??//端口復(fù)位// ????WriteCH432Data(?CH432_LCR_PORT,?BIT_LCR_DLAB?);????/*?設(shè)置DLAB為1?*/ ????WriteCH432Data(?CH432_DLL_PORT,?DLL?);????/*?設(shè)置波特率?*/ ????WriteCH432Data(?CH432_DLM_PORT,?DLM?); ????WriteCH432Data(?CH432_FCR_PORT,?BIT_FCR_FIFOEN?);????/*?設(shè)置FIFO模式,觸發(fā)點(diǎn)為14?*/ ????WriteCH432Data(?CH432_LCR_PORT,?BIT_LCR_WORDSZ1?|?BIT_LCR_WORDSZ0?);????/*?字長8位,1位停止位、無校驗(yàn)?*/ ????WriteCH432Data(?CH432_IER_PORT,?BIT_IER_IEMODEM?|?BIT_IER_IELINES?|?BIT_IER_IETHRE?|?BIT_IER_IERECV?);????/*?使能中斷?*/ ????WriteCH432Data(?CH432_MCR_PORT,?BIT_MCR_OUT2);????/*?允許中斷輸出,DTR,RTS為1?*/ /************************************************************************** ??????????設(shè)置CH432串口1的寄存器 **************************************************************************/ ????div?=?(?Fpclk?>>?4?)?/?CH432_BPS1; ????DLM?=?div?>>?8; ????DLL?=?div?&?0xff; ????WriteCH432Data(?CH432_IER1_PORT,?BIT_IER_RESET);??//端口復(fù)位// ????WriteCH432Data(?CH432_LCR1_PORT,?BIT_LCR_DLAB?);????/*?設(shè)置DLAB為1?*/ ????WriteCH432Data(?CH432_DLL1_PORT,?DLL?);????/*?設(shè)置波特率?*/ ????WriteCH432Data(?CH432_DLM1_PORT,?DLM?); ????WriteCH432Data(?CH432_FCR1_PORT,?BIT_FCR_FIFOEN?);????/*?設(shè)置FIFO模式,觸發(fā)點(diǎn)為14?*/ ????WriteCH432Data(?CH432_LCR1_PORT,?BIT_LCR_WORDSZ1?|?BIT_LCR_WORDSZ0?);????/*?字長8位,1位停止位、無校驗(yàn)?*/ ????WriteCH432Data(?CH432_IER1_PORT,?BIT_IER_IEMODEM?|?BIT_IER_IELINES?|?BIT_IER_IETHRE?|?BIT_IER_IERECV?);????/*?使能中斷?*/ ????WriteCH432Data(?CH432_MCR1_PORT,?BIT_MCR_OUT2);????/*?允許中斷輸出,DTR,RTS為1?*/