[Taranis] 6pos multiswitch fix

This commit is contained in:
Bertrand Songis
2014-02-02 22:50:36 +01:00
parent 64a8349120
commit 413c146fe0
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1284,7 +1284,7 @@ void menuGeneralHardware(uint8_t event)
} }
#endif #endif
#define XPOT_DELTA 7 #define XPOT_DELTA 5
void menuCommonCalib(uint8_t event) void menuCommonCalib(uint8_t event)
{ {
@@ -1305,7 +1305,7 @@ void menuCommonCalib(uint8_t event)
else { else {
if (reusableBuffer.calib.xpotsCalib[idx].lastCount < 255) reusableBuffer.calib.xpotsCalib[idx].lastCount++; if (reusableBuffer.calib.xpotsCalib[idx].lastCount < 255) reusableBuffer.calib.xpotsCalib[idx].lastCount++;
} }
if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 20/*200ms*/) { if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 10/*100ms*/) {
int16_t position = reusableBuffer.calib.xpotsCalib[idx].lastPosition; int16_t position = reusableBuffer.calib.xpotsCalib[idx].lastPosition;
bool found = false; bool found = false;
for (int j=0; j<count; j++) { for (int j=0; j<count; j++) {
+1 -1
View File
@@ -2519,7 +2519,7 @@ void getADC()
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
if (s_noScroll) v = temp[x] >> 1; if (s_noScroll) v = temp[x] >> 1;
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x]; StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x];
if (IS_MULTIPOS_POT(x) && calib->count>0 && calib->count<POTS_POS_COUNT) { if (!s_noScroll && IS_MULTIPOS_POT(x) && calib->count>0 && calib->count<POTS_POS_COUNT) {
uint8_t vShifted = (v >> 4); uint8_t vShifted = (v >> 4);
s_anaFilt[x] = 2*RESX; s_anaFilt[x] = 2*RESX;
for (int i=0; i<calib->count; i++) { for (int i=0; i<calib->count; i++) {