Skip to content

Commit 3054279

Browse files
Raffael Rostagnokartben
authored andcommitted
tests: drivers: pwm: Revert PWM capture change for pulse check
Reverts a change regarding how the test checks the pulse output from a capture event. A pulse capture will produce a value that has the same polarity (and range) as programmed by pwm_capture(). Checking 'pulse_capture' against 'period - pulse' means expecting the driver to return a capture value that is not inverted as well, which would cause test cases to fail. Signed-off-by: Raffael Rostagno <[email protected]>
1 parent 1b4cef3 commit 3054279

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/drivers/pwm/pwm_loopback/src/test_pwm_loopback.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,9 @@ static void test_capture(uint32_t period, uint32_t pulse, enum test_pwm_unit uni
9999
"period capture off by more than 1%");
100100
}
101101

102-
if (flags & PWM_POLARITY_INVERTED) {
103-
zassert_within(pulse_capture, period - pulse, (period - pulse) / 100,
104-
"pulse capture off by more than 1%");
105-
} else {
102+
if (flags & PWM_CAPTURE_TYPE_PULSE) {
106103
zassert_within(pulse_capture, pulse, pulse / 100,
107-
"pulse capture off by more than 1%");
104+
"pulse capture off by more than 1%");
108105
}
109106
}
110107

0 commit comments

Comments
 (0)