[test/hal] adc oneshot/temperature: wait for async completion#276
Draft
liangyongxiang wants to merge 1 commit into
Draft
[test/hal] adc oneshot/temperature: wait for async completion#276liangyongxiang wants to merge 1 commit into
liangyongxiang wants to merge 1 commit into
Conversation
vsf_adc_channel_request_once is asynchronous (result delivered via the VSF_ADC_IRQ_MASK_CPL ISR callback). The oneshot and temperature suites registered no ISR and read the sample immediately after the request. Register a completion ISR and VSF_TEST_WAIT_FOR the conversion-complete interrupt before reading the result, mirroring vsf_test_adc_stream.c. Add per-suite PRIO / TIMEOUT_MS config defaults.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vsf_adc_channel_request_onceis an asynchronous API: the conversionresult is delivered via the
VSF_ADC_IRQ_MASK_CPLISR callback, not by thetime the call returns.
The
adc_oneshotandadc_temperaturetest suites registered no ISR(
cfg.isr = {NULL, NULL, 0}) and read the sample immediately after therequest — i.e. they used the async API as if it were synchronous.
Change
Mirror the correct pattern already used by
vsf_test_adc_stream.c:volatile boolflag onVSF_ADC_IRQ_MASK_CPL;VSF_TEST_WAIT_FOR(...)the conversion-complete interrupt before reading the sample.Also add per-suite
..._PRIO(vsf_arch_prio_1) and..._TIMEOUT_MS(500)config defaults (overridable), matching the stream suite's convention.
Files:
test/.../adc/suite/vsf_test_adc_oneshot.c/.htest/.../adc/suite/vsf_test_adc_temperature.c/.hStatus / TODO
Kept as a draft until the above verification is done.