chore: fix build warnings from compiler-flagged always-true/dead-code issues - #7697
Open
pfeerick wants to merge 5 commits into
Open
chore: fix build warnings from compiler-flagged always-true/dead-code issues#7697pfeerick wants to merge 5 commits into
pfeerick wants to merge 5 commits into
Conversation
…nly targets The internal/external module OR-guard was added in #5703 without a matching case for HARDWARE_EXTERNAL_MODULE-only targets (pl18/pl18ev/pl18u) in cliSerialPassthrough's switch — the functions were compiled but never called there, producing -Wunused-function warnings. Serial passthrough over an external module isn't implemented yet, so narrow the guard to match the only call site. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g-less targets Introduced in #6095: on targets with only a CFS LED strip and no bling strip (BLING_LED_STRIP_LENGTH == 0, e.g. gx12/mt12/tx12mk2/boxer sharing the RADIO_GX12 hal config), `id >= BLING_LED_STRIP_LENGTH` is always true for the unsigned uint8_t id, triggering -Wtype-limits. Nest the bling-specific check and offset adjustment inside their own BLING_LED_STRIP_LENGTH > 0 guard, with an early return for the bling case, so bling-less targets never compile the tautological comparison at all; the CFS-handling body stays written once, shared by both paths, matching existing runtime behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…gingInfo Introduced in #6392: pa01 defines LED_CHARGING_START as 0, so `i >= LED_CHARGING_START` with the loop's unsigned uint8_t i is always true, triggering -Wtype-limits. Use a plain int loop variable so the comparisons are ordinary signed comparisons instead of testing a constant. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Introduced already-dead in #7114: the `timeout` variable and its four busy-wait loops were commented out from the start (copy-pasted from a pre-#6952 st16/pa01 sdram_driver.cpp), leaving `timeout` unused and triggering -Wunused-variable. No H750 target actually polls the SDRAM BUSY flag - they all rely on the delay_ms(100) after CLK_ENABLE - so this just catches helloradio-h750 up to jumper-h750/rm-h750/c14, which already dropped the same dead block outright rather than commenting it out (as #6952 did for st16/pa01). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same dead code as helloradio-h750 (fixed in 8309ba5): the commented-out `timeout`/busy-wait blocks in SDRAM_InitSequence() left over from before #6952 commented out just the declaration on these two targets seven months ago, but never removed the four dead wait-loop comment blocks themselves. No functional change - the loops were already commented out - this just brings pa01/st16 in line with jumper-h750/rm-h750/c14, which never had this scaffolding in the first place. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
fix(cli): drop deadspModuleInit/spModuleDeInitcompiled on EXTERNAL_MODULE-only targets (regression from feat: support for RadioMaster GX12 #5703)fix(lua): avoid always-trueBLING_LED_STRIP_LENGTHcomparison on bling-less targets, e.g. gx12 (regression from feat(radio): refactor of switch handling to better support customisable switches #6095) — hardware-tested on gx12fix(pa01): avoid always-trueLED_CHARGING_STARTcomparison inledChargingInfo(regression from feat: Flysky PA01 support #6392) — hardware-tested on pa01fix(v12): drop dead SDRAM busy-wait scaffolding inSDRAM_InitSequence(helloradio-h750), left over from feat(v12): support for HelloRadioSky V12 #7114chore(sdram): drop the same dead SDRAM busy-wait scaffolding on pa01/st16, the only remaining targets carrying it since chore: fix build warnings and cleanup code #6952These have their origins in the same warning cleanup done for the 2.12.3 backport PR (#7687) — that PR carries the backport-appropriate subset of these fixes; this PR is the
main-targeted equivalent plus the pa01/st16 SDRAM chore, which only applies tomain.Test plan
fix(lua)hardware-tested on gx12fix(pa01)hardware-tested on pa01🤖 Generated with Claude Code