diff options
| author | liang yongxiang <[email protected]> | 2018-07-21 12:34:27 +0800 |
|---|---|---|
| committer | liang yongxiang <[email protected]> | 2018-07-21 12:34:27 +0800 |
| commit | 2f402db661072d79c71ffdee1bb71cee30d86655 (patch) | |
| tree | 7263d033e3e42ce2103caa0fc12b0016bd3cc2f8 /components | |
| parent | 8aeb87222eb068cb1eb52bbf95ef634a11f9126c (diff) | |
[device][serial] call rx_indicate function only if the rx_length is not equal 0
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/serial/serial.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index f94b7eda01..856e33e979 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -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; } |
