Skip to content

Commit 2509de7

Browse files
JordanYateskartben
authored andcommitted
drivers: watchdog: stm32 iwdg: explicit single channel
The STM32 IWDG is a single channel watchdog, and therefore should be returning `-ENOMEM` when a user attempt to install additional timeouts, instead of overwriting previous values. Signed-off-by: Jordan Yates <[email protected]>
1 parent e0da2d9 commit 2509de7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/watchdog/wdt_iwdg_stm32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ static int iwdg_stm32_install_timeout(const struct device *dev,
151151
if (config->callback != NULL) {
152152
return -ENOTSUP;
153153
}
154+
if (data->reload) {
155+
/* Timeout has already been configured */
156+
return -ENOMEM;
157+
}
154158

155159
/* Calculating parameters to be applied later, on setup */
156160
iwdg_stm32_convert_timeout(timeout, &prescaler, &reload);

0 commit comments

Comments
 (0)