mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 07:46:16 +08:00
rpmsg/rpmsg_port_uart: set the signals based on the suspend/reusme state
Now peer's state can be get by the rpmsg_get_signals() api Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -375,12 +375,14 @@ static int rpmsg_port_uart_rx_thread(int argc, FAR char *argv[])
|
||||
else if (buf[i] == RPMSG_PORT_UART_SUSPEND)
|
||||
{
|
||||
rpmsgdbg("Received suspend command\n");
|
||||
atomic_fetch_and(&rpuart->port.signals, ~RPMSG_SIGNAL_RUNNING);
|
||||
nxsem_wait(&rpuart->wake);
|
||||
continue;
|
||||
}
|
||||
else if (buf[i] == RPMSG_PORT_UART_RESUME)
|
||||
{
|
||||
rpmsgdbg("Received resume command\n");
|
||||
atomic_fetch_or(&rpuart->port.signals, RPMSG_SIGNAL_RUNNING);
|
||||
nxsem_post(&rpuart->wake);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user