summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/cr50/rdd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c
index e294d42d5e..e8a7a190ea 100644
--- a/board/cr50/rdd.c
+++ b/board/cr50/rdd.c
@@ -239,12 +239,19 @@ DECLARE_CONSOLE_COMMAND(ccd, command_ccd,
static int command_sys_rst(int argc, char **argv)
{
int val;
+ char *e;
+ int ms = 20;
if (argc > 1) {
if (!strcasecmp("pulse", argv[1])) {
- ccprintf("Pulsing AP reset\n");
+ if (argc == 3) {
+ ms = strtoi(argv[2], &e, 0);
+ if (*e)
+ return EC_ERROR_PARAM2;
+ }
+ ccprintf("Pulsing AP reset for %dms\n", ms);
assert_sys_rst();
- usleep(200);
+ msleep(ms);
deassert_sys_rst();
} else if (parse_bool(argv[1], &val)) {
if (val)
@@ -262,7 +269,7 @@ static int command_sys_rst(int argc, char **argv)
}
DECLARE_SAFE_CONSOLE_COMMAND(sysrst, command_sys_rst,
- "[pulse | <BOOLEAN>]",
+ "[pulse [time] | <BOOLEAN>]",
"Assert/deassert SYS_RST_L to reset the AP");
static int command_ec_rst(int argc, char **argv)