mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 06:45:10 +03:00
[Taranis] Inputs / Mixes now correctly created on a fresh model
This commit is contained in:
parent
0c015f321a
commit
6fd9c47649
1 changed files with 11 additions and 6 deletions
|
@ -64,8 +64,9 @@ MixData* setDest(uint8_t dch, uint8_t src, bool clear=false)
|
||||||
while (1) {
|
while (1) {
|
||||||
mix = mixAddress(i);
|
mix = mixAddress(i);
|
||||||
if (mix->srcRaw && mix->destCh <= dch) {
|
if (mix->srcRaw && mix->destCh <= dch) {
|
||||||
if (clear && mix->destCh == dch)
|
if (clear && mix->destCh == dch) {
|
||||||
deleteExpoMix(0, i);
|
deleteExpoMix(0, i);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (++i==MAX_MIXERS) {
|
if (++i==MAX_MIXERS) {
|
||||||
// TODO should return null pointer but needs to be tested then
|
// TODO should return null pointer but needs to be tested then
|
||||||
|
@ -106,10 +107,14 @@ void defaultInputs()
|
||||||
clearInputs();
|
clearInputs();
|
||||||
|
|
||||||
for (int i=0; i<NUM_STICKS; i++) {
|
for (int i=0; i<NUM_STICKS; i++) {
|
||||||
s_currCh = i+1;
|
uint8_t stick_index = channel_order(i+1);
|
||||||
insertExpoMix(1, i);
|
ExpoData *expo = expoAddress(i);
|
||||||
|
expo->srcRaw = MIXSRC_Rud - 1 + stick_index;
|
||||||
|
expo->curve.type = CURVE_REF_EXPO;
|
||||||
|
expo->chn = i;
|
||||||
|
expo->weight = 100;
|
||||||
for (int c=0; c<4; c++) {
|
for (int c=0; c<4; c++) {
|
||||||
g_model.inputNames[i][c] = char2idx(STR_VSRCRAW[1+STR_VSRCRAW[0]*(expoAddress(i)->srcRaw-MIXSRC_Rud+1)+c]);
|
g_model.inputNames[i][c] = char2idx(STR_VSRCRAW[1+STR_VSRCRAW[0]*stick_index+c]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eeDirty(EE_MODEL);
|
eeDirty(EE_MODEL);
|
||||||
|
@ -163,7 +168,7 @@ void applyTemplate(uint8_t idx)
|
||||||
uint8_t icc[4] = {0};
|
uint8_t icc[4] = {0};
|
||||||
for (uint8_t i=0; i<4; i++) { //generate inverse array
|
for (uint8_t i=0; i<4; i++) { //generate inverse array
|
||||||
for(uint8_t j=0; j<4; j++)
|
for(uint8_t j=0; j<4; j++)
|
||||||
if(CC(i+1)==j+1) icc[j]=i;
|
if(CC(i+1)==j+MIXSRC_Rud) icc[j]=i;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
|
@ -177,7 +182,7 @@ void applyTemplate(uint8_t idx)
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
// Simple 4-Ch
|
// Simple 4-Ch
|
||||||
case TMPL_SIMPLE_4CH:
|
case TMPL_SIMPLE_4CH:
|
||||||
clearInputs();
|
defaultInputs();
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#pragma message("Templates with virtual inputs (FrSky Taranis) are not implemented!")
|
#pragma message("Templates with virtual inputs (FrSky Taranis) are not implemented!")
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue