tests: pwm_loopback: Fix inverted pulse measurement deviation
For the inverted pulse measurements, that should reflect the duty-cycle off interval, the 1% deviation in test_capture should be adjusted so it reflects duty-cycle off. Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
This commit is contained in:
parent
b1e863e3e7
commit
221c4d3e4d
1 changed files with 5 additions and 2 deletions
|
@ -99,9 +99,12 @@ 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_CAPTURE_TYPE_PULSE) {
|
||||
if (flags & PWM_POLARITY_INVERTED) {
|
||||
zassert_within(pulse_capture, period - pulse, (period - pulse) / 100,
|
||||
"pulse capture off by more than 1%");
|
||||
} else {
|
||||
zassert_within(pulse_capture, pulse, pulse / 100,
|
||||
"pulse capture off by more than 1%");
|
||||
"pulse capture off by more than 1%");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue