summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-02-11 16:29:50 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-20 00:07:08 +0000
commit86340a75d22659a2b57077bdd79a63ef91668320 (patch)
tree7c54fcda67b643b62476b9bbaf649ac395d0d1ff
parent91268fb85e1a09ffc3d64ea139bc7d09305c0396 (diff)
downloadchrome-ec-86340a75d22659a2b57077bdd79a63ef91668320.tar.gz
cleanup: Poke the watchdog when dumping lots of memory
If you use the "md" command to display lots of memory, it can cause the watchdog to trip. This just pokes it every now and then to be sure it's happy. BUG=none BRANCH=none TEST=manual Print a lot, see that it doesn't timeout: md 0 0x4000 Change-Id: Ic4e2746c07f4fbdf922e87ea3efbe90b88ae08c9 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/251011 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/memory_commands.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/memory_commands.c b/common/memory_commands.c
index d0fa6eb191..fb896a8d4b 100644
--- a/common/memory_commands.c
+++ b/common/memory_commands.c
@@ -6,7 +6,9 @@
/* System module for Chrome EC */
#include "console.h"
+#include "timer.h"
#include "util.h"
+#include "watchdog.h"
static int command_mem_dump(int argc, char **argv)
{
@@ -31,6 +33,13 @@ static int command_mem_dump(int argc, char **argv)
else
ccprintf(" %08x", value);
cflush();
+
+ /* Lots of output could take a while.
+ * Let other things happen, too */
+ if (!(i % 0x100)) {
+ watchdog_reload();
+ usleep(10 * MSEC);
+ }
}
ccprintf("\n");
cflush();