Fix #114: remove redundant initial state check in LC_SampleAPs - #140
philphauler wants to merge 3 commits into
Conversation
The guard on the starting AP's state prevented sampling the entire range when the first AP happened to be PERMOFF or NOT_USED. LC_SampleSingleAP already checks each AP's state individually, making this pre-check redundant and harmful.
|
Removes a redundant initial-state check that |
|
@philphauler Thank you for your contribution. Please resolve the workflow failures. |
|
Already onnit 🫡🙏 |
…check LC_SampleAPs no longer sends LC_APSAMPLE_CURR_ERR_EID when the starting actionpoint is NOT_USED or PERMOFF; LC_SampleSingleAP already ignores those states internally (only ACTIVE/PASSIVE are sampled), so the loop just skips them silently. Update LC_SampleAPs_Test_SingleActionPointError and LC_SampleAPs_Test_SingleActionPointPermOff to assert zero events sent instead of the removed error event, matching current behavior. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HDRvC9ePDP3i6xpxFAECFg
|
Tracked the coverage failure down 🔍 the two Locally (cFS dev bundle, The Build Documentation failure is unrelated to this PR: it is the doxygen |
Summary
Remove the redundant guard on the starting AP state in
LC_SampleAPs.Problem
LC_SampleAPs(StartIndex, EndIndex)checksARTPtr[StartIndex].CurrentStatebefore entering the sampling loop. If the first AP is
PERMOFForNOT_USED,the entire range is skipped and an error event is emitted -- even though
subsequent APs in the range may be operational.
LC_SampleSingleAPalready checks each AP state individually, making thispre-check redundant and harmful when a range begins with a disabled AP.
Fix
Remove the pre-check. Let
LC_SampleSingleAPhandle per-AP state filteringfor each action point in the range. Net deletion of 21 lines.