-
Notifications
You must be signed in to change notification settings - Fork 8.3k
tests: pwm_loopback: Capture disable omission issue #81198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: pwm_loopback: Capture disable omission issue #81198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not really related to missing pwm_disable_capture() calls. It should be done in a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this seems to be unneeded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
e51ea82 to
9f49762
Compare
As per the PWM API definition, -EBUSY should be returned when pwm_enable_capture is called and capturing is already enabled. This commit deals with adding a ztest_suite_before_t function that should disable capturing at the end of a single test. Some tests, though, such as test_pulse_capture, execute two sub-tests and so, capturing is disabled in between. In fact, the omission of pwm_disable_capture should not only result in aborting a single test, but it can also raise system exception due to invalid context. This is the case for z_impl_pwm_capture_cycles where z_pwm_capture_cycles_callback can be fired whilst the routine has already aborted and so struct z_pwm_capture_cb_data data, defined within function declaration, should not longer be valid. Signed-off-by: Ioannis Karachalios <[email protected]>
9f49762 to
8c93121
Compare
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 <[email protected]>
|
ping @henrikbrixandersen, if you could please re-approve |
-EBUSYshould be returned whenpwm_enable_captureis called while capturingis already enabled. This commit should deal with adding a
ztest_suite_before_tfunction that should disable capturing.Some tests, though, such as
test_pulse_capture, execute two sub-tests and so, capturing is disabled in between.In fact, the omission of
pwm_disable_captureshould not only result in aborting a single test, but it can also raise system exception due to invalid context. This is the case forz_impl_pwm_capture_cycleswherez_pwm_capture_cycles_callbackcan be fired whilst the routine has already aborted (without disabling capturing) and sostruct z_pwm_capture_cb_data data, defined within function declaration, should not longer be valid.test_captureshould be adjusted so it reflects duty-cycle off.Fixes #81199