summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-05-03 21:55:00 +0800
committerGitHub <[email protected]>2021-05-03 21:55:00 +0800
commit39aa987fc8190850d7030527c3b3bfb9aa8bc812 (patch)
tree4f27526290574600cb683fc9c453b6b804070704
parent0dfd1fa46326fb33c8cc0fc09c8e54495c348a9c (diff)
parent58065b05659deaab9d9d9297ad312d915b284d54 (diff)
Merge pull request #4632 from yaoyufan/master
fix bluetrum uart1 and uart2 cannot recv data
-rw-r--r--bsp/bluetrum/libraries/hal_drivers/drv_usart.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_usart.c b/bsp/bluetrum/libraries/hal_drivers/drv_usart.c
index f09cffee61..9e8ecdbf9f 100644
--- a/bsp/bluetrum/libraries/hal_drivers/drv_usart.c
+++ b/bsp/bluetrum/libraries/hal_drivers/drv_usart.c
@@ -229,10 +229,18 @@ void uart_irq_process(struct rt_serial_device *serial)
(serial->config.bufsz - (rx_fifo->get_index - rx_fifo->put_index));
rt_hw_interrupt_enable(level);
- if (rx_length)
- {
- shell_rx_ind();
+ if ((serial->parent.rx_indicate != RT_NULL) && (rx_length != 0)) {
+ #ifdef RT_CONSOLE_DEVICE_NAME
+ if (serial == &uart_obj[*(RT_CONSOLE_DEVICE_NAME + 4) - '0'].serial) {
+ shell_rx_ind();
+ } else
+ #endif
+ {
+ rt_kprintf("rx_indicate must loacted in the .comm section!\n");
+ //serial->parent.rx_indicate(&serial->parent, rx_length);
+ }
}
+
}
RT_SECTION(".irq.usart")