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 2022/04/27 16:36:40 UTC
[incubator-nuttx-apps] branch master updated: pmconfig: add mulit domain support
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/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new a5a4c561f pmconfig: add mulit domain support
a5a4c561f is described below
commit a5a4c561fb9c9c5c9af0013f2c3b8901a176b956
Author: zhuyanlin <zh...@xiaomi.com>
AuthorDate: Wed Apr 20 12:26:27 2022 +0800
pmconfig: add mulit domain support
pmconfig [domain]
pmconfig relax/stay state [domain]
Signed-off-by: zhuyanlin <zh...@xiaomi.com>
---
nshlib/nsh_command.c | 4 ++--
nshlib/nsh_syscmds.c | 14 ++++++++++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c
index 61fef3d18..99af79b22 100644
--- a/nshlib/nsh_command.c
+++ b/nshlib/nsh_command.c
@@ -402,8 +402,8 @@ static const struct cmdmap_s g_cmdmap[] =
#endif
#if defined(CONFIG_PM) && !defined(CONFIG_NSH_DISABLE_PMCONFIG)
- { "pmconfig", cmd_pmconfig, 1, 3,
- "[stay|relax] [normal|idle|standby|sleep]" },
+ { "pmconfig", cmd_pmconfig, 1, 4,
+ "[stay|relax] [normal|idle|standby|sleep] [domain]" },
#endif
#if defined(CONFIG_BOARDCTL_POWEROFF) && !defined(CONFIG_NSH_DISABLE_POWEROFF)
diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c
index dcad16d26..40a449113 100644
--- a/nshlib/nsh_syscmds.c
+++ b/nshlib/nsh_syscmds.c
@@ -178,7 +178,7 @@ int cmd_pmconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
};
- if (argc == 1)
+ if (argc <= 2)
{
int current_state;
int normal_count;
@@ -186,6 +186,11 @@ int cmd_pmconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
int standby_count;
int sleep_count;
+ if (argc == 2)
+ {
+ ctrl.domain = atoi(argv[1]);
+ }
+
ctrl.action = BOARDIOC_PM_QUERYSTATE;
boardctl(BOARDIOC_PM_CONTROL, (uintptr_t)&ctrl);
current_state = ctrl.state;
@@ -210,8 +215,13 @@ int cmd_pmconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
nsh_output(vtbl, "Current state %d, PM stay [%d, %d, %d, %d]\n",
current_state, normal_count, idle_count, standby_count, sleep_count);
}
- else if (argc == 3)
+ else if (argc <= 4)
{
+ if (argc == 4)
+ {
+ ctrl.domain = atoi(argv[3]);
+ }
+
if (strcmp(argv[1], "stay") == 0)
{
ctrl.action = BOARDIOC_PM_STAY;