diff --git a/tests/drivers/pwm/pwm_loopback/src/test_pwm_loopback.c b/tests/drivers/pwm/pwm_loopback/src/test_pwm_loopback.c index dbf4db8b036f5..5320d087de560 100644 --- a/tests/drivers/pwm/pwm_loopback/src/test_pwm_loopback.c +++ b/tests/drivers/pwm/pwm_loopback/src/test_pwm_loopback.c @@ -99,12 +99,9 @@ static void test_capture(uint32_t period, uint32_t pulse, enum test_pwm_unit uni "period capture off by more than 1%"); } - if (flags & PWM_POLARITY_INVERTED) { - zassert_within(pulse_capture, period - pulse, (period - pulse) / 100, - "pulse capture off by more than 1%"); - } else { + if (flags & PWM_CAPTURE_TYPE_PULSE) { zassert_within(pulse_capture, pulse, pulse / 100, - "pulse capture off by more than 1%"); + "pulse capture off by more than 1%"); } }