代码如下: 问题是RDA中断可以触发但RTO中断一直没有触发过,我设为14字节然后发送少于14字节,根本不触发RTO中断。怎么办?
P3->PMD = (P3->PMD & 0x0000FF00) | 0x00000004;
SYS->P3_MFP &= ~(SYS_MFP_P30_Msk | SYS_MFP_P31_Msk);
SYS->P3_MFP |= (SYS_MFP_P30_RXD0 | SYS_MFP_P31_TXD0);
CLK->APBCLK |= CLK_APBCLK_UART0_EN_Msk;
CLK->CLKSEL1 = (CLK->CLKSEL1 & (~CLK_CLKSEL1_UART_S_Msk)) | CLK_CLKSEL1_UART_S_HXT;
UART0->BAUD = UART_BAUD_MODE2 | UART_BAUD_MODE2_DIVIDER(__HXT, 115200);
UART0->LCR = UART_WORD_LEN_8 | UART_PARITY_NONE | UART_STOP_BIT_1;
/* Enable Interrupt and install the call back function */
UART0->FCR &= ~UART_FCR_RFITL_Msk;
UART0->FCR |= 0X00000030;
UART0->TOR = 0X00000028;
UART0->IER |= UART_IER_RDA_IEN_Msk | UART_IER_RTO_IEN_Msk ;
NVIC_EnableIRQ(UART0_IRQn); |