mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
drivers/rpmsg_port_uart: do rpmsg_port_unreigster when connected
rpmsg_port_unreigster() should be called after rpmsg_port_reigster(), so add the connected condition when receive poweroff command. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
parent
f93876228a
commit
8889bdd967
1 changed files with 7 additions and 3 deletions
|
|
@ -532,14 +532,18 @@ rpmsg_port_uart_process_rx_cmd(FAR struct rpmsg_port_uart_s *rpuart,
|
|||
count = pm_wakelock_staycount(&rpuart->rx_wakelock);
|
||||
rpmsgvbs("Received poweroff command %d 0x%x\n",
|
||||
count, rpuart->event.events);
|
||||
rpmsg_port_uart_clear(rpuart, RPMSG_PORT_UART_EVT_CONNED);
|
||||
if (rpmsg_port_uart_check(rpuart, RPMSG_PORT_UART_EVT_WAKING))
|
||||
{
|
||||
rpmsg_port_uart_set(rpuart, RPMSG_PORT_UART_EVT_WAKED);
|
||||
}
|
||||
|
||||
rpmsg_port_drop_packets(&rpuart->port, RPMSG_PORT_DROP_TXQ);
|
||||
rpmsg_port_unregister(&rpuart->port);
|
||||
if (rpmsg_port_uart_check(rpuart, RPMSG_PORT_UART_EVT_CONNED))
|
||||
{
|
||||
rpmsg_port_drop_packets(&rpuart->port, RPMSG_PORT_DROP_TXQ);
|
||||
rpmsg_port_unregister(&rpuart->port);
|
||||
rpmsg_port_uart_clear(rpuart, RPMSG_PORT_UART_EVT_CONNED);
|
||||
}
|
||||
|
||||
DEBUGVERIFY(file_ioctl(&rpuart->file, TIOCVHANGUP, 0) >= 0);
|
||||
if (count != 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue