summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Cross <sean@xobs.io>2020-05-22 12:56:14 +0800
committerSean Cross <sean@xobs.io>2020-05-27 11:28:49 +0800
commit8c5df5f7329f84c005d217d18148b616f55b942f (patch)
tree18f484c7111822603c5b3f9a355b2cff40191bac
parent08362c9cabce24ffdc2bd6018ab7fc3e9e6e4801 (diff)
supervisor: add a new WATCHDOG_RESET safe mode reason
This mode will be used if the board is reset due to the watchdog expiring. Signed-off-by: Sean Cross <sean@xobs.io>
-rw-r--r--supervisor/shared/safe_mode.c3
-rw-r--r--supervisor/shared/safe_mode.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c
index c957aee53..a167ab392 100644
--- a/supervisor/shared/safe_mode.c
+++ b/supervisor/shared/safe_mode.c
@@ -160,6 +160,9 @@ void print_safe_mode_message(safe_mode_t reason) {
case MEM_MANAGE:
serial_write_compressed(translate("Invalid memory access."));
break;
+ case WATCHDOG_RESET:
+ serial_write_compressed(translate("Watchdog timer expired."));
+ break;
default:
serial_write_compressed(translate("Unknown reason."));
break;
diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h
index 5b09c4b54..c160739ae 100644
--- a/supervisor/shared/safe_mode.h
+++ b/supervisor/shared/safe_mode.h
@@ -41,6 +41,7 @@ typedef enum {
NORDIC_SOFT_DEVICE_ASSERT,
FLASH_WRITE_FAIL,
MEM_MANAGE,
+ WATCHDOG_RESET,
} safe_mode_t;
safe_mode_t wait_for_safe_mode_reset(void);