ITE drivers/watchdog: clean up the #ifdef
Use if(IS_ENABLED(...)) {...} instead. Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
This commit is contained in:
parent
4aa6e98292
commit
7b43deedd5
1 changed files with 14 additions and 14 deletions
|
@ -213,23 +213,23 @@ static void wdt_it8xxx2_isr(const struct device *dev)
|
|||
data->callback(dev, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WDT_ITE_REDUCE_WARNING_LEADING_TIME
|
||||
/*
|
||||
* Once warning timer triggered: if watchdog timer isn't reloaded,
|
||||
* then we will reduce interval of warning timer to 30ms to print
|
||||
* more warning messages before watchdog reset.
|
||||
*/
|
||||
if (!wdt_warning_fired) {
|
||||
uint16_t cnt0 = WARNING_TIMER_PERIOD_MS_TO_1024HZ_COUNT(30);
|
||||
if (IS_ENABLED(CONFIG_WDT_ITE_REDUCE_WARNING_LEADING_TIME)) {
|
||||
/*
|
||||
* Once warning timer triggered: if watchdog timer isn't reloaded,
|
||||
* then we will reduce interval of warning timer to 30ms to print
|
||||
* more warning messages before watchdog reset.
|
||||
*/
|
||||
if (!wdt_warning_fired) {
|
||||
uint16_t cnt0 = WARNING_TIMER_PERIOD_MS_TO_1024HZ_COUNT(30);
|
||||
|
||||
/* pre-warning timer1 is 16-bit counter down timer */
|
||||
inst->ET1CNTLHR = (cnt0 >> 8) & 0xff;
|
||||
inst->ET1CNTLLR = cnt0 & 0xff;
|
||||
/* pre-warning timer1 is 16-bit counter down timer */
|
||||
inst->ET1CNTLHR = (cnt0 >> 8) & 0xff;
|
||||
inst->ET1CNTLLR = cnt0 & 0xff;
|
||||
|
||||
/* clear pre-warning timer1 interrupt status */
|
||||
ite_intc_isr_clear(DT_INST_IRQN(0));
|
||||
/* clear pre-warning timer1 interrupt status */
|
||||
ite_intc_isr_clear(DT_INST_IRQN(0));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
wdt_warning_fired++;
|
||||
|
||||
LOG_DBG("WDT ISR");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue