Skip to content

Commit 7b7129b

Browse files
Wealian Liaonashif
authored andcommitted
driver: wdt: npcx: Remove watchdog reset waiting loop in ISR
NPCX watchdog driver has a WDT_NPCX_DELAY_CYCLES for delay the watchdog reset time after the watchdog timeout. For some systems, users would like to use the watchdog timeout ISR but don't reset the chip immediately. Let the system have the final chance to ongoing the system before the real hardware reset time. Removing the watchdog reset waiting loop in ISR lets users decide whether wait for watchdog reset by themself. Signed-off-by: Wealian Liao <[email protected]>
1 parent 248aebb commit 7b7129b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/watchdog/wdt_npcx.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,13 @@ static void wdt_t0out_isr(const struct device *dev, struct npcx_wui *wui)
114114
struct wdt_npcx_data *const data = DRV_DATA(dev);
115115
ARG_UNUSED(wui);
116116

117+
LOG_DBG("WDT reset will issue after %d delay cycle! WUI(%d %d %d)",
118+
CONFIG_WDT_NPCX_DELAY_CYCLES, wui->table, wui->group, wui->bit);
119+
117120
/* Handle watchdog event here. */
118121
if (data->cb) {
119122
data->cb(dev, 0);
120123
}
121-
122-
LOG_DBG("WDT issued! WUI(%d %d %d)", wui->table, wui->group, wui->bit);
123-
124-
/* Wait for watchdog event and reset occurred! */
125-
while (1)
126-
;
127124
}
128125

129126
static void wdt_config_t0out_interrupt(const struct device *dev)

0 commit comments

Comments
 (0)