Fix mistyped target macros that silently disable features - #11955
sensei-hacker wants to merge 2 commits into
Conversation
check_macro_typos.py flagged target.h defines that resemble typos of real INAV macros. Verified each against driver/core usage and fixed the confirmed cases: - IFLIGHT_H743_AIO_V2, JHEH7AIO: BEEPER_PIN -> BEEPER. The beeper driver gates on #ifdef BEEPER, so the beeper was silently compiled out. - RADIOLINKF405: USE_SERIAL_3WAY_BLHELI_INTERFACE -> USE_SERIAL_4WAY_BLHELI_INTERFACE. The 4-way BLHeli passthrough was compiled out (no 3WAY macro exists in core). - BETAFPVF435: ADC_CHANNEL1/2/3_PIN -> ADC_CHANNEL_1/2/3_PIN. adcInit disables channels whose *_PIN macro is missing, so VBAT/current/RSSI ADC was dead. Also dropped a duplicate INVERTER_PIN_USART3_RX. - AIKONF7, BETAFPVF435, BROTHERHOBBYF405V3, PRINCIPIOTF7: removed the never-implemented USE_FLASH_W25M* / W25M* cruft (all four still define the real USE_FLASH_W25N01G).
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoFix target macro typos that silently disable features
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper |
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #11955 245 targets built. Find your board's
|
The Betaflight->INAV converter emitted USE_FLASH_W25M/W25M02G/W25M512 for every converted target, but that flash family has no driver (targets use W25N01G). Removing them from the supported list prevents the dead macros from being regenerated on future conversions.
Summary
Fixes mistyped/dead
#defines in 7 target headers that silently disabledfeatures, found by
check_macro_typos.pyand verified against driver/coreusage (not the tool's heuristic alone).
Changes
BEEPER_PIN→BEEPER. The beeperdriver (
sound_beeper.c) gates on#ifdef BEEPER, so the beeper wassilently compiled out and the pin left floating.
USE_SERIAL_3WAY_BLHELI_INTERFACE→USE_SERIAL_4WAY_BLHELI_INTERFACE. Core only tests the4WAYname, so4-way BLHeli passthrough was compiled out.
ADC_CHANNEL1/2/3_PIN→ADC_CHANNEL_1/2/3_PIN. Themissing underscore made
adcInit(drivers/adc.c) rundisableChannelMapping()for those channels, so VBAT/current/RSSI ADCwas dead. Also removed a duplicate
INVERTER_PIN_USART3_RX.USE_FLASH_W25M*/W25M*/W25M512*/W25M02G*cruft — that flashfamily was never implemented in any driver; all four targets still define
the real
USE_FLASH_W25N01G(+ pin/bus), whichflash_w25n.cconsumes.W25M/W25M02G/W25M512entriesfrom the converter's supported-flash-chips list so future Betaflight→INAV
conversions don't regenerate the dead macros.
Testing
Build-tested every touched target (via inav-builder) against
release/9.1—all 7 succeeded with no errors and no warnings:
Not hardware-tested (config-only
#definefixes; each rename was verifiedagainst the consuming driver and each pin against its target's pin map).
Code Review
Reviewed with the inav-code-review agent — APPROVE (no critical/important
issues). The one minor follow-up it noted (the converter's dead
W25Mentries) is addressed in this PR.
Left alone (verified NOT bugs)
ICM20608_CS_PIN/ICM20608_SPI_BUS— locally-consistent label,board uses
DEVHW_MPU6500(ICM20608G WHO_AM_I); renaming would be cosmetic.SPI1_NSS1_PIN/SPI1_NSS2_PIN— intentional dual-gyro CSvariants, consumed locally by
GYRO1_CS_PIN/GYRO2_CS_PIN.VBAT_SCALE_DEFAULT2— single harmless dead define.