diff --git a/drivers/watchdog/wdt_rpi_pico.c b/drivers/watchdog/wdt_rpi_pico.c index 4f82627b5e8..83285ba659e 100644 --- a/drivers/watchdog/wdt_rpi_pico.c +++ b/drivers/watchdog/wdt_rpi_pico.c @@ -9,6 +9,7 @@ #include #include #include +#include #include LOG_MODULE_REGISTER(wdt_rpi_pico, CONFIG_WDT_LOG_LEVEL); @@ -101,7 +102,7 @@ static int wdt_rpi_pico_install_timeout(const struct device *dev, const struct w if (cfg->window.min != 0U || cfg->window.max == 0U) { return -EINVAL; - } else if (cfg->window.max > RPI_PICO_MAX_WDT_TIME) { + } else if (cfg->window.max * USEC_PER_MSEC > RPI_PICO_MAX_WDT_TIME) { return -EINVAL; } else if (cfg->callback != NULL) { return -ENOTSUP; @@ -113,7 +114,7 @@ static int wdt_rpi_pico_install_timeout(const struct device *dev, const struct w return -EINVAL; } - data->load = (cfg->window.max * RPI_PICO_WDT_TIME_MULTIPLICATION_FACTOR); + data->load = (cfg->window.max * USEC_PER_MSEC * RPI_PICO_WDT_TIME_MULTIPLICATION_FACTOR); data->reset_type = (cfg->flags & WDT_FLAG_RESET_MASK); return 0;