You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/01/09 01:48:26 UTC

(nuttx) 03/04: rpmsg/rpmsg_port_uart: set the signals based on the suspend/reusme state

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3d764939c8308242ba4eafb9336908e460864dfe
Author: Bowen Wang <wa...@xiaomi.com>
AuthorDate: Mon Dec 23 22:47:17 2024 +0800

    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 <wa...@xiaomi.com>
---
 drivers/rpmsg/rpmsg_port_uart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rpmsg/rpmsg_port_uart.c b/drivers/rpmsg/rpmsg_port_uart.c
index 50c0fb9d247..49a152c1148 100644
--- a/drivers/rpmsg/rpmsg_port_uart.c
+++ b/drivers/rpmsg/rpmsg_port_uart.c
@@ -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;
             }