feat: Remove TR# mixsrc when trainer disabled (#2323)

* feat: Remove TR# mixsrc when trainer disabled
When trainer mode is not enabled, there is no point
showing the TR# mixer sources. Once you enable a
trainer option, they will become visible again.

* fix: Add missing "Input" check for B&W radios

* fix(cpn): Trainer mode default is off

* chore(cpn): If trainer mode off, hide TR/PPM srcs

* (cpn) Refresh all source lists on change of trainer mode

Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
Peter Feerick
2022-09-25 19:51:35 +10:00
committed by GitHub
co-authored by elecpower
parent 41cfeee5b0
commit 3969b2b7e3
5 changed files with 16 additions and 3 deletions
+6 -1
View File
@@ -55,7 +55,12 @@ void insertExpo(uint8_t idx)
ExpoData * expo = expoAddress(idx);
memmove(expo+1, expo, (MAX_EXPOS-(idx+1))*sizeof(ExpoData));
memclear(expo, sizeof(ExpoData));
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
for (int i = s_currCh; i < INPUTSRC_LAST; i++) {
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + i: MIXSRC_Rud - 1 + channelOrder(i));
if (isSourceAvailableInInputs(expo->srcRaw)) {
break;
}
}
expo->curve.type = CURVE_REF_EXPO;
expo->mode = 3; // pos+neg
expo->chn = s_currCh - 1;