Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cpn): T-Pro function switches #4902

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

elecpower
Copy link
Collaborator

@elecpower elecpower commented Apr 21, 2024

Fixes #4898

Note: I have not tested on hardware or simulator

@elecpower elecpower added companion Related to the companion software bug/regression ↩️ A new version of EdgeTX broke something labels Apr 21, 2024
@elecpower elecpower added this to the 2.10 milestone Apr 21, 2024
@elecpower elecpower requested a review from 3djc April 21, 2024 04:05
@3djc
Copy link
Collaborator

3djc commented Apr 21, 2024

No no no, the customisable (function) switches name need to be displayed as SWx for end users, on radio too (and always have been, sorry if I have been unclear).

The issue with 'alias' names is only those where used in yaml before 2.10

@elecpower
Copy link
Collaborator Author

So the only change needs to be in yaml_rawswitch.cpp decode to map SE -> SW1 thru SJ - SW6 for T-Pro radios only. The encode yaml is SW1 thru SW6. Correct?

@elecpower elecpower marked this pull request as draft April 21, 2024 07:16
@3djc
Copy link
Collaborator

3djc commented Apr 21, 2024

In 2.9, customisable switches are displayed SW1 to SW6 on radio, and encoded in yaml as SE to SJ for TPro
In 2.10, customisable switches are displayed SW1 to SW6 on radio, and encoded in yaml as SW1 to SW6 for TPro

I belive TPro was the only radio with customisable switches in 2.9

@elecpower elecpower force-pushed the elecpower/cpn-fix-4898-func-switches branch from cc7e630 to 9223690 Compare April 21, 2024 10:48
@elecpower elecpower marked this pull request as ready for review April 21, 2024 10:49
@elecpower
Copy link
Collaborator Author

@3djc hopefully I have got it right this time

@3djc
Copy link
Collaborator

3djc commented Apr 21, 2024

2.9.4:

customFn: 
   0:
      swtch: "SE2"
      func: OVERRIDE_CHANNEL
      def: "0,0,0"
   1:
      swtch: "SJ2"
      func: OVERRIDE_CHANNEL
      def: "0,0,0"

Opening in 2.10 companion (this PR)
Read perfectly:
image

Save to radio:

customFn:
  0:
    swtch: SW12
    func: OVERRIDE_CHANNEL
    def: 0,0,0
  1:
    swtch: SW62
    func: OVERRIDE_CHANNEL
    def: 0,0,0

Open with 2.10rc3
image

PERFECT !

@3djc 3djc added the blocks-release Releases shouldn't go out without this fix label Apr 21, 2024
@arkarkark
Copy link

This isn't going to conflict with the t-pro v2 having extra switches between the triggers and the pots which it calls SE and SF, right? the v1 t-pro doesn't have these switches.

@pfeerick
Copy link
Member

pfeerick commented Apr 21, 2024

It shouldn't no. The TPro V1 actually does have those switches, but they default to None as they are very hard trigger on the V1 (the trim caps go in too far making it hard to press) and IIRC was never advertised as a feature.

Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

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

A read/write cycle is working fine here on TPro V1 hardware also on Windows with a more elaborate setup. No customisable switches were harmed 🤭

image

image

@pfeerick pfeerick merged commit 55944ab into main Apr 25, 2024
3 checks passed
@pfeerick pfeerick deleted the elecpower/cpn-fix-4898-func-switches branch April 25, 2024 01:21
@pfeerick pfeerick added blocks-release Releases shouldn't go out without this fix and removed blocks-release Releases shouldn't go out without this fix labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocks-release Releases shouldn't go out without this fix bug/regression ↩️ A new version of EdgeTX broke something companion Related to the companion software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

companion v2.10-rc3 loses switch settings from v2.9.2 file
4 participants