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:
Bowen Wang
2024-12-23 22:47:17 +08:00
committed by Xiang Xiao
parent b8ad562fcb
commit 3d764939c8
+2
View File
@@ -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;
}