From 07303f43019379010a35e85bb15f50c03df5327d Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 23 Jul 2014 18:23:24 +0200 Subject: [PATCH] Taranis calibration better fix --- radio/src/gui/menu_general.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index 25b303cad..32d13d5fe 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -1587,23 +1587,25 @@ void menuCommonCalib(uint8_t event) for (uint8_t i=POT1; i<=POT_LAST; i++) { int idx = i - POT1; int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount; - if (IS_POT_MULTIPOS(i) && count > 1 && count <= XPOTS_MULTIPOS_COUNT) { - for (int j=0; j 1 && count <= XPOTS_MULTIPOS_COUNT) { + for (int j=0; jcount = count - 1; + for (int j=0; jcount; j++) { + calib->steps[j] = (reusableBuffer.calib.xpotsCalib[idx].steps[j+1] + reusableBuffer.calib.xpotsCalib[idx].steps[j]) >> 5; + } } - StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[i]; - calib->count = count - 1; - for (int j=0; jcount; j++) { - calib->steps[j] = (reusableBuffer.calib.xpotsCalib[idx].steps[j+1] + reusableBuffer.calib.xpotsCalib[idx].steps[j]) >> 5; + else { + g_eeGeneral.potsType &= ~(0x03<<(2*idx)); } } - else { - g_eeGeneral.potsType &= ~(0x03<<(2*idx)); - } } #endif g_eeGeneral.chkSum = evalChkSum();