drivers: watchdog: mcux_wwdt: fix validating window min vs max
The comparison was inverted before so configuring a valid window providing min and max was not possible. Now the comparison is corrected and only done if the watchdog is used in windowed mode. Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
This commit is contained in:
parent
a865b1bb49
commit
ebcc316e1c
1 changed files with 3 additions and 2 deletions
|
@ -97,8 +97,9 @@ static int mcux_wwdt_install_timeout(const struct device *dev,
|
|||
}
|
||||
|
||||
if ((data->wwdt_config.timeoutValue < MIN_TIMEOUT) ||
|
||||
(data->wwdt_config.timeoutValue > data->wwdt_config.windowValue)) {
|
||||
LOG_ERR("Invalid timeout");
|
||||
((data->wwdt_config.windowValue != 0xFFFFFFU) &&
|
||||
(data->wwdt_config.timeoutValue <
|
||||
data->wwdt_config.windowValue))) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue