Skip to content

Commit

Permalink
apps/coremark: Tickle watchdog in coremark shell command
Browse files Browse the repository at this point in the history
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 <jerzy@apache.org>
  • Loading branch information
kasjer committed Jun 7, 2024
1 parent 3ea5f71 commit 309b6d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions util/coremark/src/coremark_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 309b6d2

Please sign in to comment.