This is an automated email from the ASF dual-hosted git repository.
agross 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 4c5522a9e da1469x: Add option to not disable watchdog on init
4c5522a9e is described below
commit 4c5522a9e5665b03f149c4e194f86ce87bb52098
Author: Andy Gross <[email protected]>
AuthorDate: Fri Sep 23 13:32:10 2022 -0500
da1469x: Add option to not disable watchdog on init
This patch adds a facility to control whether or not the Dialog watchdog is
disabled when the hal_watchdog_init function is being called.
Signed-off-by: Andy Gross <[email protected]>
---
hw/mcu/dialog/da1469x/src/hal_watchdog.c | 5 ++++-
hw/mcu/dialog/da1469x/syscfg.yml | 5 +++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/mcu/dialog/da1469x/src/hal_watchdog.c
b/hw/mcu/dialog/da1469x/src/hal_watchdog.c
index c8e07fbd5..d7c7bbeff 100644
--- a/hw/mcu/dialog/da1469x/src/hal_watchdog.c
+++ b/hw/mcu/dialog/da1469x/src/hal_watchdog.c
@@ -27,7 +27,10 @@ int
hal_watchdog_init(uint32_t expire_msecs)
{
SYS_WDOG->WATCHDOG_CTRL_REG =
SYS_WDOG_WATCHDOG_CTRL_REG_WDOG_FREEZE_EN_Msk;
+
+#if MYNEWT_VAL(MCU_WATCHDOG_DISABLE_ON_INIT)
GPREG->SET_FREEZE_REG |= GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk;
+#endif
#if MYNEWT_VAL_CHOICE(MCU_LPCLK_SOURCE, RCX)
g_hal_watchdog_reload_val = expire_msecs / 21;
@@ -40,7 +43,7 @@ hal_watchdog_init(uint32_t expire_msecs)
/* wait */
}
SYS_WDOG->WATCHDOG_REG = g_hal_watchdog_reload_val;
-
+
return 0;
}
diff --git a/hw/mcu/dialog/da1469x/syscfg.yml b/hw/mcu/dialog/da1469x/syscfg.yml
index 2fecdc0cd..fe4e45b6e 100644
--- a/hw/mcu/dialog/da1469x/syscfg.yml
+++ b/hw/mcu/dialog/da1469x/syscfg.yml
@@ -454,6 +454,11 @@ syscfg.defs:
restrictions:
- '!GPADC_BATTERY'
+ MCU_WATCHDOG_DISABLE_ON_INIT:
+ description: >
+ 'Disable watchdog on init'
+ value: 1
+
syscfg.vals:
OS_TICKS_PER_SEC: 128