Companion core in simu now understood: the stickMode was completely out,

and the Tx trims were shifted!
This commit is contained in:
Bertrand Songis
2014-01-14 22:44:10 +01:00
parent d945052c82
commit 0f0db5e1d3
6 changed files with 16 additions and 15 deletions
@@ -128,7 +128,7 @@ bool hasExtendedTrims()
uint8_t getStickMode()
{
return g_eeGeneral.stickMode;
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
}
void resetTrims()
@@ -200,7 +200,7 @@ void OpentxTaranisSimulator::setValues(TxInputs &inputs)
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
{
idx = Open9xX9D::modn12x3[4*getStickMode() + idx] - 1;
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
setTrimValue(phase, idx, value);
}
@@ -214,7 +214,7 @@ void OpentxTaranisSimulator::getTrims(Trims & trims)
}
for (int i=0; i<2; i++) {
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i] - 1;
uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
int16_t tmp = trims.values[i];
trims.values[i] = trims.values[idx];
trims.values[idx] = tmp;