Skip to content

Commit

Permalink
drivers: pwm: stm32: Catch overflows in 2-channel capture
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gumulka authored and carlescufi committed Jan 3, 2024
1 parent ec42d82 commit 3c0a605
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/pwm/pwm_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,11 @@ 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->overflows) {
LOG_ERR("counter overflow during PWM capture");
status = -ERANGE;
}

if (!cpt->continuous) {
Expand Down

0 comments on commit 3c0a605

Please sign in to comment.