|
|
@@ -119,19 +119,23 @@ static wdt_hal_context_t rtc_wdt_ctx = {.inst = WDT_RWDT, .rwdt_dev = &RTCCNTL};
|
|
|
#else
|
|
|
static wdt_hal_context_t rtc_wdt_ctx = {.inst = WDT_RWDT, .rwdt_dev = &LP_WDT};
|
|
|
#endif
|
|
|
+static bool rtc_wdt_ctx_enabled = false;
|
|
|
static wdt_hal_context_t wdt0_context = {.inst = WDT_MWDT0, .mwdt_dev = &TIMERG0};
|
|
|
-static wdt_hal_context_t wdt1_context = {.inst = WDT_MWDT1, .mwdt_dev = &TIMERG1};
|
|
|
-
|
|
|
static bool wdt0_context_enabled = false;
|
|
|
+#if SOC_TIMER_GROUPS >= 2
|
|
|
+static wdt_hal_context_t wdt1_context = {.inst = WDT_MWDT1, .mwdt_dev = &TIMERG1};
|
|
|
static bool wdt1_context_enabled = false;
|
|
|
-static bool rtc_wdt_ctx_enabled = false;
|
|
|
+#endif // SOC_TIMER_GROUPS
|
|
|
+
|
|
|
/**
|
|
|
* Disable all enabled WDTs
|
|
|
*/
|
|
|
static inline void disable_all_wdts(void)
|
|
|
{
|
|
|
wdt0_context_enabled = wdt_hal_is_enabled(&wdt0_context);
|
|
|
+ #if SOC_TIMER_GROUPS >= 2
|
|
|
wdt1_context_enabled = wdt_hal_is_enabled(&wdt1_context);
|
|
|
+ #endif
|
|
|
rtc_wdt_ctx_enabled = wdt_hal_is_enabled(&rtc_wdt_ctx);
|
|
|
|
|
|
/*Task WDT is the Main Watchdog Timer of Timer Group 0 */
|
|
|
@@ -142,6 +146,7 @@ static inline void disable_all_wdts(void)
|
|
|
wdt_hal_write_protect_enable(&wdt0_context);
|
|
|
}
|
|
|
|
|
|
+ #if SOC_TIMER_GROUPS >= 2
|
|
|
/* Interupt WDT is the Main Watchdog Timer of Timer Group 1 */
|
|
|
if (true == wdt1_context_enabled) {
|
|
|
wdt_hal_write_protect_disable(&wdt1_context);
|
|
|
@@ -149,6 +154,8 @@ static inline void disable_all_wdts(void)
|
|
|
wdt_hal_feed(&wdt1_context);
|
|
|
wdt_hal_write_protect_enable(&wdt1_context);
|
|
|
}
|
|
|
+ #endif // SOC_TIMER_GROUPS >= 2
|
|
|
+
|
|
|
if (true == rtc_wdt_ctx_enabled) {
|
|
|
wdt_hal_write_protect_disable(&rtc_wdt_ctx);
|
|
|
wdt_hal_disable(&rtc_wdt_ctx);
|
|
|
@@ -168,12 +175,14 @@ static inline void enable_all_wdts(void)
|
|
|
wdt_hal_enable(&wdt0_context);
|
|
|
wdt_hal_write_protect_enable(&wdt0_context);
|
|
|
}
|
|
|
+ #if SOC_TIMER_GROUPS >= 2
|
|
|
/* Interupt WDT is the Main Watchdog Timer of Timer Group 1 */
|
|
|
if (false == wdt1_context_enabled) {
|
|
|
wdt_hal_write_protect_disable(&wdt1_context);
|
|
|
wdt_hal_enable(&wdt1_context);
|
|
|
wdt_hal_write_protect_enable(&wdt1_context);
|
|
|
}
|
|
|
+ #endif // SOC_TIMER_GROUPS >= 2
|
|
|
|
|
|
if (false == rtc_wdt_ctx_enabled) {
|
|
|
wdt_hal_write_protect_disable(&rtc_wdt_ctx);
|