drivers: pwm: stm32: Catch overflows in 2-channel capture

When not using 4 channel capture, overflows were never reported
to the application, because the check was in the
four_channel_capture_support branch.

Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
This commit is contained in:
Fabian Pflug 2023-12-21 15:27:42 +01:00 committed by Carles Cufí
parent ec42d825ec
commit 3c0a6058b5

View file

@ -732,12 +732,12 @@ static void pwm_stm32_isr(const struct device *dev)
/* Still waiting for a complete capture */
return;
}
}
if (cpt->overflows) {
LOG_ERR("counter overflow during PWM capture");
status = -ERANGE;
}
}
if (!cpt->continuous) {
pwm_stm32_disable_capture(dev, cpt->channel);