[device][serial] call rx_indicate function only if the rx_length is not equal 0

This commit is contained in:
liang yongxiang 2018-07-21 12:34:27 +08:00
parent 8aeb87222e
commit 2f402db661
1 changed files with 4 additions and 1 deletions

View File

@ -1180,7 +1180,10 @@ void rt_hw_serial_isr(struct rt_serial_device *serial, int event)
(serial->config.bufsz - (rx_fifo->get_index - rx_fifo->put_index));
rt_hw_interrupt_enable(level);
serial->parent.rx_indicate(&serial->parent, rx_length);
if (rx_length)
{
serial->parent.rx_indicate(&serial->parent, rx_length);
}
}
break;
}