PoKeys: dodanie wsparcia dla rozszerzeń PoExt

This commit is contained in:
firleju
2016-03-31 19:32:54 +02:00
parent e2672725f3
commit 0aa7a67531
4 changed files with 70 additions and 21 deletions

View File

@@ -288,17 +288,27 @@ void Console::ValueSet(int x, double y)
if (iMode == 4)
if (PoKeys55[0])
{
if (Global::fCalibrateOutMax[x] > 0)
{
y = y / Global::fCalibrateOutMax[x]; // sprowadzenie do <0,1> jeśli podana maksymalna wartość
y = Global::CutValueToRange(0, y, Global::fCalibrateOutMax[x]);
}
PoKeys55[0]->PWM(
x, (((((Global::fCalibrateOut[x][5] * y) + Global::fCalibrateOut[x][4]) * y +
if (x == 7)
{
PoKeys55[0]->PoExtUpdate(8, y);
} // nbmx: wal kulakowy
else
{
if (Global::fCalibrateOutMax[x] > 0)
{
y = Global::CutValueToRange(0, y, Global::fCalibrateOutMax[x]);
y = y / Global::fCalibrateOutMax[x]; // sprowadzenie do <0,1> jeśli podana maksymalna wartość
}
double temp = (((((Global::fCalibrateOut[x][5] * y) + Global::fCalibrateOut[x][4]) * y +
Global::fCalibrateOut[x][3]) * y + Global::fCalibrateOut[x][2]) * y +
Global::fCalibrateOut[x][1]) * y +
Global::fCalibrateOut[x][0]); // zakres <0;1>
Global::fCalibrateOut[x][1]) * y +
Global::fCalibrateOut[x][0] // zakres <0;1>
PoKeys55[0]->PWM(x, temp);
if (x == 6)
{
PoKeys55[0]->PoExtUpdate(9, temp); //dodatkowo hasler na PoExt
}
}
}
};