Merge pull request #923 from opentx/dvogonen/Fix_channel_odering_922
OK, if the code isn't duplicated, it is needed. So in it goes.
This commit is contained in:
@@ -916,6 +916,15 @@ RawSource GeneralSettings::getDefaultSource(unsigned int channel) const
|
|||||||
return RawSource(SOURCE_TYPE_STICK, stick_index);
|
return RawSource(SOURCE_TYPE_STICK, stick_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GeneralSettings::translateSource(unsigned int channel) const
|
||||||
|
{
|
||||||
|
for(int i=0; i<4; i++){
|
||||||
|
if (chout_ar[4*templateSetup + i]==(channel+1))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void FrSkyData::clear()
|
void FrSkyData::clear()
|
||||||
{
|
{
|
||||||
memset(this, 0, sizeof(FrSkyData));
|
memset(this, 0, sizeof(FrSkyData));
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ class GeneralSettings {
|
|||||||
GeneralSettings();
|
GeneralSettings();
|
||||||
|
|
||||||
RawSource getDefaultSource(unsigned int channel) const;
|
RawSource getDefaultSource(unsigned int channel) const;
|
||||||
|
int translateSource(unsigned int channel) const;
|
||||||
|
|
||||||
unsigned int version;
|
unsigned int version;
|
||||||
unsigned int variant;
|
unsigned int variant;
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int
|
|||||||
MixData & mix = model.mixData[mixIndex++];
|
MixData & mix = model.mixData[mixIndex++];
|
||||||
mix.destCh = channel+1;
|
mix.destCh = channel+1;
|
||||||
if (isTaranis){
|
if (isTaranis){
|
||||||
RawSource tmpSource = settings.getDefaultSource( input-1 );
|
int source = settings.translateSource(input-1);
|
||||||
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, tmpSource.index, &model);
|
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, source, &model);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mix.srcRaw = RawSource(SOURCE_TYPE_STICK, input-1);
|
mix.srcRaw = RawSource(SOURCE_TYPE_STICK, input-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user