diff --git a/radio/src/gui/horus/menu_general_calib.cpp b/radio/src/gui/horus/menu_general_calib.cpp index cd5480752..d473507b1 100644 --- a/radio/src/gui/horus/menu_general_calib.cpp +++ b/radio/src/gui/horus/menu_general_calib.cpp @@ -60,7 +60,7 @@ bool menuCommonCalib(evt_t event) drawScreenTemplate(NULL, OPTION_MENU_NO_FOOTER); for (uint8_t i=0; i> 1; reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]); reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]); if (i >= POT1 && i <= POT_LAST) { @@ -125,8 +125,8 @@ bool menuCommonCalib(evt_t event) for (int i=0; i> 1; + if (i < NUM_XPOTS) { reusableBuffer.calib.xpotsCalib[i].stepsCount = 0; reusableBuffer.calib.xpotsCalib[i].lastCount = 0; } @@ -146,9 +146,6 @@ bool menuCommonCalib(evt_t event) g_eeGeneral.calib[i].spanPos = v - v/STICK_TOLERANCE; } } - break; - - case 3: for (int i=POT1; i<=POT_LAST; i++) { int idx = i - POT1; int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount; @@ -172,6 +169,9 @@ bool menuCommonCalib(evt_t event) } } } + break; + + case 3: g_eeGeneral.chkSum = evalChkSum(); storageDirty(EE_GENERAL); calibrationState = 4; @@ -186,20 +186,6 @@ bool menuCommonCalib(evt_t event) drawSticks(); drawPots(); - for (int i=POT1; i<=POT_LAST; i++) { - uint8_t steps = 0; - if (calibrationState == 2) { - steps = reusableBuffer.calib.xpotsCalib[i-POT1].stepsCount; - } - else if (IS_POT_MULTIPOS(i)) { - StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[i]; - steps = calib->count + 1; - } - if (calibrationState != 0 && steps > 0 && steps <= XPOTS_MULTIPOS_COUNT) { - lcdDrawNumber(LCD_W/2+3-(POT_BAR_INTERVAL*NUM_POTS/2)+(POT_BAR_INTERVAL*(i-POT1)), POT_BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]"); - } - } - return true; } diff --git a/radio/src/gui/taranis/menu_general_calib.cpp b/radio/src/gui/taranis/menu_general_calib.cpp index c1f375ddb..fa89b0998 100644 --- a/radio/src/gui/taranis/menu_general_calib.cpp +++ b/radio/src/gui/taranis/menu_general_calib.cpp @@ -41,7 +41,7 @@ void drawPotsBars() void menuCommonCalib(uint8_t event) { for (uint8_t i=0; i> 1; reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]); reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]); if (i >= POT1 && i <= POT_LAST) { @@ -108,7 +108,7 @@ void menuCommonCalib(uint8_t event) for (uint8_t i=0; i> 1; if (i> 3; -#if defined(VIRTUALINPUTS) - - if (calibrationState) { - v = temp[x] >> 1; - } #if defined(JITTER_FILTER) - else { - // jitter filter - uint16_t diff = (v > s_anaFilt[x]) ? (v - s_anaFilt[x]) : (s_anaFilt[x] - v); - if (diff < 10) { - // apply filter - v = (7 * s_anaFilt[x] + v) >> 3; - } + // jitter filter + uint16_t diff = (v > s_anaFilt[x]) ? (v - s_anaFilt[x]) : (s_anaFilt[x] - v); + if (diff < 10) { + // apply filter + v = (7 * s_anaFilt[x] + v) >> 3; } #endif @@ -1587,8 +1575,9 @@ void getADC() } #endif +#if defined(VIRTUALINPUTS) StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x]; - if (!calibrationState && IS_POT_MULTIPOS(x) && calib->count>0 && calib->countcount>0 && calib->count> 4); s_anaFilt[x] = 2*RESX; for (int i=0; icount; i++) {