Skip to content

feat: Jumper T22#7420

Open
3djc wants to merge 3 commits into
mainfrom
JP-T22
Open

feat: Jumper T22#7420
3djc wants to merge 3 commits into
mainfrom
JP-T22

Conversation

@3djc
Copy link
Copy Markdown
Collaborator

@3djc 3djc commented Jun 1, 2026

Support for Jumper T22 ELRS transmiter

T22£®1£© 358

Summary by CodeRabbit

  • New Features

    • Added full support for the Jumper T22: hardware definition, firmware target, companion integration, USB identity, and YAML/schema entries enabling T22 builds and device support.
  • Chores

    • Updated CI/workflows, build configuration, and generation scripts to include the T22 target and adjusted default generation tokens.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a1c480f-7e90-4718-b8f2-2ecf2899d5af

📥 Commits

Reviewing files that changed from the base of the PR and between 98a0f57 and 2a2df04.

📒 Files selected for processing (2)
  • radio/src/targets/t22/CMakeLists.txt
  • radio/src/targets/t22/hal.h
💤 Files with no reviewable changes (1)
  • radio/src/targets/t22/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • radio/src/targets/t22/hal.h

📝 Walkthrough

Walkthrough

Adds full Jumper T22 support: companion board registration, T22 HAL and CMake target, board hardware JSON, generated YAML storage schema, and build/CI/tooling integration.

Changes

Jumper T22 Board Support

Layer / File(s) Summary
Companion board registration and properties
companion/src/firmwares/boards.h, companion/src/firmwares/boards.cpp, companion/src/firmwares/opentx/opentxinterface.cpp
Board::Type adds BOARD_JUMPER_T22 with IS_JUMPER_T22; companion returns TARANIS EEPROM size, 1MB flash, name "Jumper T22", CROSSFIRE default internal module, and registers an OpenTx firmware variant with FrSky/FLEX options.
T22 HAL and CMake target configuration
radio/src/targets/t22/hal.h, radio/src/targets/t22/usb_descriptor.h, radio/src/targets/t22/CMakeLists.txt
New HAL header and USB descriptor macros; CMake target declares build options, compile flags, object libraries, peripheral/feature wiring, and thread-safe malloc compile define.
T22 board hardware definitions
radio/src/boards/hw_defs/t22.json
JSON declares ADCs/analog inputs, 2POS/3POS switches, keys, trims, display config, custom switches, and hardware capability identifiers.
YAML storage schema and integration
radio/src/storage/yaml/yaml_datastructs_t22.cpp, radio/src/storage/yaml/yaml_datastructs.cpp, radio/src/storage/yaml/CMakeLists.txt
Generated YAML schema with enum-to-string tables, YamlNode descriptors for RadioData/ModelData/PartialModel, and public accessors; integrated via CMake and conditional include for RADIO_T22.
Build/CI/tooling integration
radio/src/CMakeLists.txt, radio/src/datastructs.h, radio/src/hal/rotary_encoder.h, radio/util/hw_defs/legacy_names.py, tools/build-common.sh, tools/generate-yaml.sh, tools/generate-hw-defs.sh, .github/workflows/build_fw.yml, fw.json
T22 added to PCB type list and include dispatch, datastruct size preprocessor branches, rotary encoder granularity selection, legacy inputs mapping, build option dispatch, YAML/hw-gen default flavors, CI test/build matrices, and firmware targets metadata.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks a proper summary section required by the template; it only contains a one-line statement and an image, without detailing the actual changes made. Add a 'Summary of changes' section explaining the T22 support implementation, hardware definitions, build configuration, and any breaking/non-breaking changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Jumper T22' clearly indicates a feature addition for Jumper T22 hardware support, which aligns with the extensive changes across firmware, build config, and companion code.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JP-T22

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Add/align battery voltage range mapping for BOARD_JUMPER_T22

BOARD_JUMPER_T22 isn’t included in Boards::getBattRange() (switch at companion/src/firmwares/boards.cpp ~812-878), so it uses the default BR(60, 80, 65). In the same switch, BOARD_JUMPER_T16/T18/T20(+T20V2) use BR(67, 83, 66), while BOARD_JUMPER_T15/T15PRO also fall back to the default due to missing cases. Confirm T22’s battery pack specs; if it matches the T16/T18/T20 group, add BOARD_JUMPER_T22 to 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 value

Redundant assignment.

AFHDS3 is already declared as an option with default ON at 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 win

Remove duplicate assignment.

FUNCTION_SWITCHES_WITH_RGB is already set to YES on 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 win

Unreachable conditional block.

This if(FUNCTION_SWITCHES) block will always execute when FUNCTION_SWITCHES_WITH_RGB is true (which it is, hardcoded on lines 28 and 64), because line 95 already sets FUNCTION_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

📥 Commits

Reviewing files that changed from the base of the PR and between 00d7544 and 98a0f57.

📒 Files selected for processing (20)
  • .github/workflows/build_fw.yml
  • companion/src/firmwares/boards.cpp
  • companion/src/firmwares/boards.h
  • companion/src/firmwares/opentx/opentxinterface.cpp
  • fw.json
  • radio/src/CMakeLists.txt
  • radio/src/boards/hw_defs/t22.json
  • radio/src/datastructs.h
  • radio/src/hal/rotary_encoder.h
  • radio/src/storage/yaml/CMakeLists.txt
  • radio/src/storage/yaml/yaml_datastructs.cpp
  • radio/src/storage/yaml/yaml_datastructs_t22.cpp
  • radio/src/targets/t15pro/hal.h
  • radio/src/targets/t22/CMakeLists.txt
  • radio/src/targets/t22/hal.h
  • radio/src/targets/t22/usb_descriptor.h
  • radio/util/hw_defs/legacy_names.py
  • tools/build-common.sh
  • tools/generate-hw-defs.sh
  • tools/generate-yaml.sh
💤 Files with no reviewable changes (1)
  • radio/src/targets/t15pro/hal.h

Comment thread radio/src/targets/t22/hal.h
@pfeerick pfeerick added this to the 3.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants