串口接收例程错误 NONOS_SDK-2.2.0

fangmr
Posts: 2
Joined: Wed Apr 04, 2018 9:20 am

串口接收例程错误 NONOS_SDK-2.2.0

Postby fangmr » Thu May 24, 2018 4:25 pm

在驱动的里面的 uart.c 里面的例程有错误!

536 行 uart_rx_intr_enable(UART0);

正确的应该是 关闭中断,这里反而是打开了中断!

//move data from uart fifo to rx buffer
void Uart_rx_buff_enq()
{
.......

if(pRxBuffer->Space >= UART_FIFO_LEN){
//os_printf("after rx enq buf enough\n\r");
uart_rx_intr_enable(UART0); //错误在这里
}
}

jacklin
Posts: 19
Joined: Wed Apr 04, 2018 11:37 am

Re: 串口接收例程错误 NONOS_SDK-2.2.0

Postby jacklin » Fri Jun 15, 2018 2:42 pm

好好看中断实现的流程,当接收发出中断后,首先会调用uart_rx_intr_disable关闭中断,中断服务程序完了需要uart_rx_intr_enable重新打开。

Who is online

Users browsing this forum: Baidu [Spider] and 9 guests