Skip to content

feat(color): selectable trainer lead wiring for Flysky radios - #37

Closed
pfeerick wants to merge 4 commits into
mainfrom
pfeerick/trainer-jack-crossover
Closed

pfeerick wants to merge 4 commits into
mainfrom
pfeerick/trainer-jack-crossover

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Fork PR for CI firmware builds and bench testing. Not for upstream yet.

Trainer lead option

Some radios put trainer input and output on different 3.5mm jack contacts and ship with a crossover lead. On PL18U, EL18 and PA01, input is on the tip and output on the ring. ST16 was defined the other way round; this PR swaps its pins to match (see below). With a mono lead, as used by most other radios, the ring is grounded, so whichever direction is on the ring stops working. Pulling the plug partly out works around it.

This adds a Trainer lead option to Radio Setup → Hardware on boards that set trainer_jack_crossover in their hw_defs:

  • Crossover (default): existing behaviour.
  • Standard: input and output both on the tip, for mono or straight leads.

Flagged boards: PL18, PL18EV, PL18U, NB4P, NV14, EL18, PA01 and ST16. On all of them input is on the tip, so Standard simply sends on the input pin as well. Of these, only PL18U, EL18, PA01 and ST16 have been tested so far, and only on firmware without this change. The others use the same pins as PL18U and EL18.

The setting takes a spare bit in the colour-screen radio settings, so the settings struct doesn't grow. It's added to the YAML for all colour targets but only used on flagged boards. Changing it restarts the trainer on the new contacts straight away.

Alternative to EdgeTX#6970, which moves PL18-family output to the tip unconditionally and would break pairing over the supplied crossover lead.

Companion

Companion reads and writes trainerTipOnly and shows the same Crossover / Standard choice on its Hardware page for flagged boards, so saving radio settings from Companion keeps the setting.

ST16 pin swap

ST16 had trainer in on PE5 (ring) and out on PE6 (tip), so it couldn't pair with the other Flysky radios over the crossover lead. The schematic's MCU sheet names PE5 PPM_IN and PE6 PPM_OUT, but the jack sheet labels the PE6 path PPM_INPUT and the PE5 path PPM_OUTPUT. Each path is only a 200R resistor plus ESD clamps, so this follows the jack sheet: in on PE6 (tip), out on PE5 (ring). This is a behaviour change for ST16: on the default Crossover setting it now pairs with PL18U/EL18/PA01 over the supplied lead, and slave over a mono lead needs Standard.

Also included

fix(bw): TR_JACK_MODES was built from the country-code strings, so the Jack mode option on X-Lite S and X-Lite Pro showed US/JP/EU instead of Ask/Audio/Trainer.

Test plan

  • PL18U, EL18, PA01, ST16 with a Pocket over a mono lead, set to Standard: master and slave both work with the plug fully in.
  • Same radios set to Crossover: pairing over the supplied crossover lead still works.
  • Switching the option while the trainer is running takes effect without a reboot.

Known gaps

  • The new strings are English in all languages.

🤖 Generated with Claude Code

pfeerick and others added 4 commits October 31, 2026 02:17
Flysky radios (PL18 family, NV14, EL18, NB4P, PA01, ST16) put trainer in
and out on different 3.5mm jack contacts, and ship with a crossover lead
to suit. With a mono lead, as used by most other radios, the ring is
grounded, so whichever direction is on the ring stops working.

Add a "Trainer lead" option in Radio Setup > Hardware on these boards:
- Crossover (default): existing behaviour, in and out on their own contacts
- Standard: in and out both on the tip, for mono or straight leads

Boards opt in via "trainer_jack_crossover" in their hw_defs; boards whose
output (rather than input) is on the tip also set "trainer_jack_tip_is_out"
(ST16). The setting takes a spare bit in the COLORLCD radio settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TR_JACK_MODES was built from the TR_COUNTRY_CODES strings since EdgeTX#6502,
so the Jack mode option (X-Lite S / X-Lite Pro) listed US/JP/EU rather
than Ask/Audio/Trainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Companion support for the radio "Trainer lead" setting (trainerTipOnly):
read and write it in radio settings so saving from Companion no longer
resets it, and show a Crossover / Standard choice on the Hardware page
for boards with "trainer_jack_crossover" in their hw_defs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ST16 had trainer in on PE5 (jack ring) and out on PE6 (jack tip), the
opposite of the PL18 family and PA01, so it couldn't pair with them over
the Flysky crossover lead in either direction.

The schematic names PE5 PPM_IN and PE6 PPM_OUT on the MCU sheet, but the
jack sheet labels the PE6 path PPM_INPUT and the PE5 path PPM_OUTPUT.
Each is only a 200R series resistor plus ESD clamps, so either pin can
drive or capture. Following the jack sheet gives in on the tip and out on
the ring, matching the other Flysky radios.

With every crossover board now having input on the tip, tip-only mode
just sends on the input pin, so trainer_jack_tip_is_out is no longer
needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick pfeerick closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant