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

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f7243fb8 apps/coremark: Tickle watchdog in coremark shell command
5f7243fb8 is described below

commit 5f7243fb8ed863963c6eabfe1b5e30e099d8f7c6
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Jun 7 19:41:44 2024 +0200

    apps/coremark: Tickle watchdog in coremark shell command
    
    This simply tickle watchdog before and after running
    coremark to prevent accidental reboot during command
    execution if watchdog was enabled.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 util/coremark/src/coremark_shell.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/util/coremark/src/coremark_shell.c 
b/util/coremark/src/coremark_shell.c
index a736da8d8..4d5ef7c5f 100644
--- a/util/coremark/src/coremark_shell.c
+++ b/util/coremark/src/coremark_shell.c
@@ -20,8 +20,7 @@
 #include <os/mynewt.h>
 
 #include <shell/shell.h>
-#include <parse/parse.h>
-#include <stdio.h>
+#include <hal/hal_watchdog.h>
 #include <coremark/coremark_api.h>
 
 extern uint32_t SystemCoreClock;
@@ -32,7 +31,13 @@ coremark_shell_cmd(int argc, char **argv)
     printf("Coremark running on %s at %lu MHz\n\n",
            MYNEWT_VAL(BSP_NAME), SystemCoreClock / 1000000L);
 
+    if(MYNEWT_VAL(WATCHDOG_INTERVAL) > 0) {
+        hal_watchdog_tickle();
+    }
     coremark_run();
+    if(MYNEWT_VAL(WATCHDOG_INTERVAL) > 0) {
+        hal_watchdog_tickle();
+    }
 
     return 0;
 }

Reply via email to