Skip to content

Commit 2877bdc

Browse files
RuibinChangcfriedt
authored andcommitted
ITE drivers/watchdog: reduce interval of warning timer
Reduce interval of warning timer, so we can print more warning messages (ex. MEPC, task ID...) before watchdog reset. Signed-off-by: Ruibin Chang <[email protected]>
1 parent f2b9ba1 commit 2877bdc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/watchdog/wdt_ite_it8xxx2.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ static void wdt_it8xxx2_isr(const struct device *dev)
199199
{
200200
struct wdt_it8xxx2_data *data = DRV_DATA(dev);
201201
struct wdt_it8xxx2_regs *const inst = DRV_REG(dev);
202-
uint16_t cnt0 = WARNING_TIMER_PERIOD_MS_TO_1024HZ_COUNT(data->timeout);
203202

204203
/* clear pre-warning timer1 interrupt status */
205204
ite_intc_isr_clear(DT_INST_IRQN(0));
@@ -213,10 +212,13 @@ static void wdt_it8xxx2_isr(const struct device *dev)
213212
}
214213

215214
/*
216-
* Reduce interval of warning timer, so we can print more
217-
* warning messages during critical period.
215+
* Once warning timer triggered: if watchdog timer isn't reloaded,
216+
* then we will reduce interval of warning timer to 30ms to print
217+
* more warning messages before watchdog reset.
218218
*/
219219
if (!wdt_warning_fired++) {
220+
uint16_t cnt0 = WARNING_TIMER_PERIOD_MS_TO_1024HZ_COUNT(30);
221+
220222
/* pre-warning timer1 is 16-bit counter down timer */
221223
inst->ET1CNTLHR = (cnt0 >> 8) & 0xff;
222224
inst->ET1CNTLLR = cnt0 & 0xff;

0 commit comments

Comments
 (0)