This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UART1 中断配置 只进一次中断就不进了

Other Parts Discussed in Thread: EK-TM4C123GXL


ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
//
GPIOPinConfigure(GPIO_PB0_U1RX);
GPIOPinConfigure(GPIO_PB1_U1TX);

ROM_IntMasterEnable();

ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
ROM_UARTConfigSetExpClk(UART1_BASE, ROM_SysCtlClockGet(),9600 ,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
ROM_IntEnable(INT_UART1);
ROM_UARTIntEnable(UART1_BASE,UART_INT_RX);


void
UARTIntHandler(void)
{
uint32_t ui32Status;

UARTSend( "AAAA",4 );//UART0
//
// Get the interrrupt status.
//
ui32Status = ROM_UARTIntStatus(UART1_BASE, true);

//
// Clear the asserted interrupts.
//
ROM_UARTIntClear(UART1_BASE, ui32Status);
UARTSend( "ui32Status IS", 12 );
UART0_send_int64_t((int64_t)ui32Status,1);
//
// Loop while there are characters in the receive FIFO.
//
while(ROM_UARTCharsAvail(UART1_BASE))
{
//
// Read the next character from the UART and write it back to the UART.
//
ROM_UARTCharPutNonBlocking(UART1_BASE,
ROM_UARTCharGetNonBlocking(UART1_BASE));
UART0_send_char( ROM_UARTCharGetNonBlocking(UART1_BASE) );
//
// Blink the LED to show a character transfer is occuring.
//
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2);

//
// Delay for 1 millisecond. Each SysCtlDelay is about 3 clocks.
//
SysCtlDelay(SysCtlClockGet() / (1000 * 3));

//
// Turn off the LED
//
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0);

}
}