From a014a19f0e67f209bb162add6837387683911c3a Mon Sep 17 00:00:00 2001 From: ligd Date: Wed, 11 May 2022 12:20:54 +0800 Subject: [PATCH] rptun_ping: add sleep param to rptun_ping Signed-off-by: ligd --- drivers/rptun/rptun_ping.c | 2 ++ include/nuttx/rptun/rptun.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/rptun/rptun_ping.c b/drivers/rptun/rptun_ping.c index 60055cef37..76ab8c59c0 100644 --- a/drivers/rptun/rptun_ping.c +++ b/drivers/rptun/rptun_ping.c @@ -161,6 +161,8 @@ int rptun_ping(FAR struct rpmsg_endpoint *ept, min = MIN(min, tm); max = MAX(max, tm); total += tm; + + usleep(ping->sleep * USEC_PER_MSEC); } syslog(LOG_INFO, "current CPU freq: %" PRIu32 ", ping times: %d\n", diff --git a/include/nuttx/rptun/rptun.h b/include/nuttx/rptun/rptun.h index 2405ebe023..6d17377909 100644 --- a/include/nuttx/rptun/rptun.h +++ b/include/nuttx/rptun/rptun.h @@ -349,6 +349,7 @@ struct rptun_ping_s int times; int len; bool ack; + int sleep; /* unit: ms */ }; /****************************************************************************