Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds full Jumper T22 support: companion board registration, T22 HAL and CMake target, board hardware JSON, generated YAML storage schema, and build/CI/tooling integration. ChangesJumper T22 Board Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
companion/src/firmwares/boards.cpp (1)
812-878:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd/align battery voltage range mapping for
BOARD_JUMPER_T22
BOARD_JUMPER_T22isn’t included inBoards::getBattRange()(switch atcompanion/src/firmwares/boards.cpp~812-878), so it uses the defaultBR(60, 80, 65). In the same switch,BOARD_JUMPER_T16/T18/T20(+T20V2)useBR(67, 83, 66), whileBOARD_JUMPER_T15/T15PROalso fall back to the default due to missing cases. Confirm T22’s battery pack specs; if it matches the T16/T18/T20 group, addBOARD_JUMPER_T22to that case.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@companion/src/firmwares/boards.cpp` around lines 812 - 878, Boards::getBattRange is missing BOARD_JUMPER_T22 (so it falls to the default BR(60,80,65)); if T22 uses the same battery spec as the T16/T18/T20 group, add BOARD_JUMPER_T22 to the case that contains BOARD_JUMPER_T16, BOARD_JUMPER_T18, BOARD_JUMPER_T20, BOARD_JUMPER_T20V2 so it uses BR(67,83,66). Update the switch in Boards::getBattRange to include BOARD_JUMPER_T22 in that case (or choose the appropriate BR values if T22 differs).
🧹 Nitpick comments (3)
radio/src/targets/t22/CMakeLists.txt (3)
104-104: 💤 Low valueRedundant assignment.
AFHDS3is already declared as an option with defaultONat line 4.♻️ Proposed fix
add_definitions(-DFUNCTION_SWITCHES) endif() -set(AFHDS3 ON) - # VCP CLI set(ENABLE_SERIAL_PASSTHROUGH ON CACHE BOOL "Enable serial passthrough")🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@radio/src/targets/t22/CMakeLists.txt` at line 104, Remove the redundant assignment set(AFHDS3 ON) that overrides the option already declared as option(AFHDS3 ...) earlier; instead rely on the existing option default or, if you intended to force-enable it, update the option declaration or use set(AFHDS3 ON CACHE BOOL "AFHDS3 support" FORCE) — otherwise simply delete the set(AFHDS3 ON) line so the option's default remains authoritative.
64-64: ⚡ Quick winRemove duplicate assignment.
FUNCTION_SWITCHES_WITH_RGBis already set toYESon line 28.♻️ Proposed fix
set(FIRMWARE_DEPENDENCIES datacopy) set(SOFTWARE_KEYBOARD ON) set(FLYSKY_GIMBAL OFF) -set(FUNCTION_SWITCHES_WITH_RGB YES)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@radio/src/targets/t22/CMakeLists.txt` at line 64, Remove the duplicate CMake variable assignment by deleting the redundant set(FUNCTION_SWITCHES_WITH_RGB YES) occurrence; locate the second occurrence of FUNCTION_SWITCHES_WITH_RGB in the CMakeLists (the later assignment) and remove it so the single initial set(FUNCTION_SWITCHES_WITH_RGB YES) remains.
100-102: ⚡ Quick winUnreachable conditional block.
This
if(FUNCTION_SWITCHES)block will always execute whenFUNCTION_SWITCHES_WITH_RGBis true (which it is, hardcoded on lines 28 and 64), because line 95 already setsFUNCTION_SWITCHES. The definition on line 101 is also redundant with line 96.♻️ Proposed fix
add_definitions(-DFUNCTION_SWITCHES) add_definitions(-DFUNCTION_SWITCHES_RGB_LEDS) endif() - -if(FUNCTION_SWITCHES) -add_definitions(-DFUNCTION_SWITCHES) -endif()🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@radio/src/targets/t22/CMakeLists.txt` around lines 100 - 102, The FUNCTION_SWITCHES conditional in the CMakeLists section is effectively unreachable and redundant because FUNCTION_SWITCHES is already set earlier when FUNCTION_SWITCHES_WITH_RGB is enabled. Remove the unnecessary if(FUNCTION_SWITCHES) block and the duplicate add_definitions(-DFUNCTION_SWITCHES) from this target setup, keeping the existing definition path that already enables the symbol through the earlier configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@radio/src/targets/t22/hal.h`:
- Around line 22-42: The DMA stream comment in hal.h is inconsistent: it lists
"Stream4: ADC_DMA_STREAM" under DMA1 but the project uses DMA2_Stream4 for the
main ADC (see ADC1 referenced in t22.json), so update the block in hal.h to
remove or clarify the DMA1 Stream4 entry (either delete the "Stream4:
ADC_DMA_STREAM" line or annotate it to indicate which ADC or peripheral it
references and that the main ADC uses DMA2_Stream4); ensure the comment mentions
ADC1 → DMA2_Stream4 (or otherwise documents the alternate ADC) so readers can
reconcile ADC_DMA_STREAM with the actual DMA2_Stream4 mapping.
---
Outside diff comments:
In `@companion/src/firmwares/boards.cpp`:
- Around line 812-878: Boards::getBattRange is missing BOARD_JUMPER_T22 (so it
falls to the default BR(60,80,65)); if T22 uses the same battery spec as the
T16/T18/T20 group, add BOARD_JUMPER_T22 to the case that contains
BOARD_JUMPER_T16, BOARD_JUMPER_T18, BOARD_JUMPER_T20, BOARD_JUMPER_T20V2 so it
uses BR(67,83,66). Update the switch in Boards::getBattRange to include
BOARD_JUMPER_T22 in that case (or choose the appropriate BR values if T22
differs).
---
Nitpick comments:
In `@radio/src/targets/t22/CMakeLists.txt`:
- Line 104: Remove the redundant assignment set(AFHDS3 ON) that overrides the
option already declared as option(AFHDS3 ...) earlier; instead rely on the
existing option default or, if you intended to force-enable it, update the
option declaration or use set(AFHDS3 ON CACHE BOOL "AFHDS3 support" FORCE) —
otherwise simply delete the set(AFHDS3 ON) line so the option's default remains
authoritative.
- Line 64: Remove the duplicate CMake variable assignment by deleting the
redundant set(FUNCTION_SWITCHES_WITH_RGB YES) occurrence; locate the second
occurrence of FUNCTION_SWITCHES_WITH_RGB in the CMakeLists (the later
assignment) and remove it so the single initial set(FUNCTION_SWITCHES_WITH_RGB
YES) remains.
- Around line 100-102: The FUNCTION_SWITCHES conditional in the CMakeLists
section is effectively unreachable and redundant because FUNCTION_SWITCHES is
already set earlier when FUNCTION_SWITCHES_WITH_RGB is enabled. Remove the
unnecessary if(FUNCTION_SWITCHES) block and the duplicate
add_definitions(-DFUNCTION_SWITCHES) from this target setup, keeping the
existing definition path that already enables the symbol through the earlier
configuration.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 58d8a51c-d473-4ed2-81f2-e9cbd2517b55
📒 Files selected for processing (20)
.github/workflows/build_fw.ymlcompanion/src/firmwares/boards.cppcompanion/src/firmwares/boards.hcompanion/src/firmwares/opentx/opentxinterface.cppfw.jsonradio/src/CMakeLists.txtradio/src/boards/hw_defs/t22.jsonradio/src/datastructs.hradio/src/hal/rotary_encoder.hradio/src/storage/yaml/CMakeLists.txtradio/src/storage/yaml/yaml_datastructs.cppradio/src/storage/yaml/yaml_datastructs_t22.cppradio/src/targets/t15pro/hal.hradio/src/targets/t22/CMakeLists.txtradio/src/targets/t22/hal.hradio/src/targets/t22/usb_descriptor.hradio/util/hw_defs/legacy_names.pytools/build-common.shtools/generate-hw-defs.shtools/generate-yaml.sh
💤 Files with no reviewable changes (1)
- radio/src/targets/t15pro/hal.h
Support for Jumper T22 ELRS transmiter
Summary by CodeRabbit
New Features
Chores