[Taranis] 6pos multiswitch adjustments

This commit is contained in:
Bertrand Songis
2014-02-02 21:51:42 +01:00
parent 698885f645
commit cb7cb4aaf8
+5 -5
View File
@@ -1284,7 +1284,7 @@ void menuGeneralHardware(uint8_t event)
}
#endif
#define XPOT_DELTA 5
#define XPOT_DELTA 7
void menuCommonCalib(uint8_t event)
{
@@ -1305,7 +1305,7 @@ void menuCommonCalib(uint8_t event)
else {
if (reusableBuffer.calib.xpotsCalib[idx].lastCount < 255) reusableBuffer.calib.xpotsCalib[idx].lastCount++;
}
if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 8/*80ms*/) {
if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 20/*200ms*/) {
int16_t position = reusableBuffer.calib.xpotsCalib[idx].lastPosition;
bool found = false;
for (int j=0; j<count; j++) {
@@ -1318,9 +1318,6 @@ void menuCommonCalib(uint8_t event)
if (count < POTS_POS_COUNT) {
reusableBuffer.calib.xpotsCalib[idx].steps[count] = position;
}
else {
g_eeGeneral.potsType &= !(1<<idx);
}
reusableBuffer.calib.xpotsCalib[idx].stepsCount += 1;
}
}
@@ -1404,6 +1401,9 @@ void menuCommonCalib(uint8_t event)
calib->steps[j] = (reusableBuffer.calib.xpotsCalib[idx].steps[j+1] + reusableBuffer.calib.xpotsCalib[idx].steps[j]) >> 5;
}
}
else {
g_eeGeneral.potsType &= ~(1<<idx);
}
}
#endif
g_eeGeneral.chkSum = evalChkSum();