目前使用STM32+CH432,可以收发,但在设置INT#中断为外部输入中断后,即使两个串口有信息回复,也无法触发INT#中断,如果把void CH432Interrupt(void) 函数放在进程中轮询,INT#中断才会触发,但是正常流程应该是把CH432Interrupt(void)函数放在INT#中断服务函数里执行,请问可能是什么原因?
配置如下:
UINT16 div; UINT8 DLL, DLM; /************************************************************************** 设置CH432串口0的寄存器 **************************************************************************/ div = ( Fpclk >> 4 ) / CH432_BPS0; DLM = div >> 8; DLL = div & 0xff; WriteCH432Data( CH432_IER_PORT, BIT_IER_RESET); //端口复位// WriteCH432Data( CH432_LCR_PORT, BIT_LCR_DLAB ); /* 设置DLAB为1 */ WriteCH432Data( CH432_DLL_PORT, DLL ); /* 设置波特率 */ WriteCH432Data( CH432_DLM_PORT, DLM ); WriteCH432Data( CH432_FCR_PORT, BIT_FCR_FIFOEN ); /* 设置FIFO模式,触发点为14 */ WriteCH432Data( CH432_LCR_PORT, BIT_LCR_WORDSZ1 | BIT_LCR_WORDSZ0 ); /* 字长8位,1位停止位、无校验 */ 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 */ /************************************************************************** 设置CH432串口1的寄存器 **************************************************************************/ div = ( Fpclk >> 4 ) / CH432_BPS1; DLM = div >> 8; DLL = div & 0xff; WriteCH432Data( CH432_IER1_PORT, BIT_IER_RESET); //端口复位// WriteCH432Data( CH432_LCR1_PORT, BIT_LCR_DLAB ); /* 设置DLAB为1 */ WriteCH432Data( CH432_DLL1_PORT, DLL ); /* 设置波特率 */ WriteCH432Data( CH432_DLM1_PORT, DLM ); WriteCH432Data( CH432_FCR1_PORT, BIT_FCR_FIFOEN ); /* 设置FIFO模式,触发点为14 */ WriteCH432Data( CH432_LCR1_PORT, BIT_LCR_WORDSZ1 | BIT_LCR_WORDSZ0 ); /* 字长8位,1位停止位、无校验 */ 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 */