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();