-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Fixed support for Radiomaster TX12 additional switches (SI and SJ) #1303
Conversation
Two connectors are present on TX12 main board (near top of internal TX module) and are mapped as SI and SJ, but were not read out by the firmware. With this update they might be used for some further hacking of the radio (ex. adding additional 2-pos switches, adding detector of external module insertion etc.).
Are the SI/SJ connectors two or three pin (thus two or three position?). I'm assuming two pin, since you defined them as a 2POS, and thus this is needed also to limit them as 2POS max (otherwise 3POS will appear as an option also). diff --git a/radio/src/gui/common/stdlcd/radio_hardware.cpp b/radio/src/gui/common/stdlcd/radio_hardware.cpp
index 67de15c46..339052c65 100644
--- a/radio/src/gui/common/stdlcd/radio_hardware.cpp
+++ b/radio/src/gui/common/stdlcd/radio_hardware.cpp
@@ -210,7 +210,8 @@ enum {
#elif defined(RADIO_ZORRO)
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SB - MIXSRC_FIRST_SWITCH == sw || MIXSRC_SC - MIXSRC_FIRST_SWITCH == sw) ? SWITCH_3POS : SWITCH_2POS)
#elif defined(RADIO_TX12) || defined(RADIO_T8)
- #define SWITCH_TYPE_MAX(sw) ((MIXSRC_SA - MIXSRC_FIRST_SWITCH == sw || MIXSRC_SD - MIXSRC_FIRST_SWITCH == sw) ? SWITCH_2POS : SWITCH_3POS)
+ #define SWITCH_TYPE_MAX(sw) ((MIXSRC_SA - MIXSRC_FIRST_SWITCH == sw || MIXSRC_SD - MIXSRC_FIRST_SWITCH == sw || \
+ MIXSRC_SI - MIXSRC_FIRST_SWITCH == sw || MIXSRC_SJ - MIXSRC_FIRST_SWITCH) ? SWITCH_2POS : SWITCH_3POS)
#elif defined(RADIO_T12)
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SG - MIXSRC_FIRST_SWITCH == sw || MIXSRC_SH - MIXSRC_FIRST_SWITCH == sw) ? SWITCH_2POS : SWITCH_3POS)
#else
|
@piotrva would it be possible for you to edit the first post above and add an image showing the SI & SJ connectors on the TX12 mainboard (ideally circle or arrow them with a short button wiring info) in case further users wish to follow your path, test this PR and also for documentation purposes. Thanks! |
Also noticed - in keys debug screen they display as SG and SH... |
Switches were displayed in test screen as SG and SH, due to fact that firmware did not take into account no presence of SG and SH in TX12. The update provides correct and consistent naming of the additional switches across whole radio.
So debug screen naming is corrected now - I think I check operation of additional switches across whole firmware and everything LGTM for this small update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just added a commit fixing some other issues in the diags screen on the TX12 (which are not due to your changes) since I noticed the alignment for the switches was slightly out and the rotary encoder info was overlapping the TELE button.
I've since tried this out on my TX12, and it is working perfectly - can see SI and SJ and can see them being toggled when I short out the indicated connectors. Tried them on some mixer lines and they seemed to be working fine there also.
* Fixed support for Radiomaster TX12 additional switches (SI and SJ) Two connectors are present on TX12 main board (near top of internal TX module) and are mapped as SI and SJ, but were not read out by the firmware. With this update they might be used for some further hacking of the radio (ex. adding additional 2-pos switches, adding detector of external module insertion etc.). * Radiomaster TX12 - preventing selection of Si and SJ as 3POS * Radiomaster TX12 - corrected SI and SJ switch names in Keys Debug screen Switches were displayed in test screen as SG and SH, due to fact that firmware did not take into account no presence of SG and SH in TX12. The update provides correct and consistent naming of the additional switches across whole radio. * Alignment tweak + fix rot_enc info overlap Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
*Somebody* (me) forgot ternary operator only compares two value in #1303
*Somebody* (me) forgot ternary operator only compares two value in #1303
…OS (EdgeTX#1548) * fix: SE and SF could not be set 3POS *Somebody* (me) forgot ternary operator only compares two value in EdgeTX#1303 * fix: TX12 default contrast is too high There is no 'perfect' value due to manufacturing variance, but 25 is simply too high, and 15 a bit too low.
Two connectors are present on TX12 main board (near top of internal TX module) and are mapped as SI (2) and SJ (1), but were not read out by the firmware.
With this update they might be used for some further hacking of the radio (ex. adding additional 2-pos switches, adding detector of external module insertion etc.).
Resubmitted PR #1302
Summary of changes: