[X12S] Radio calibration regression fix

This commit is contained in:
Bertrand Songis
2016-08-19 09:51:50 +02:00
parent f940fcdcd0
commit fcce94a868
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ enum CalibrationState {
CALIB_FINISHED
};
#define STICK_PANEL_WIDTH 68
#define STICK_PANEL_WIDTH 68
void drawStick(coord_t x, coord_t y, const BitmapBuffer * background, int16_t xval, int16_t yval)
{
@@ -82,7 +82,7 @@ bool menuCommonCalib(event_t event)
drawMenuTemplate(NULL, ICON_RADIO_CALIBRATION, NULL, OPTION_MENU_NO_FOOTER);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_MOUSE_ANALOGS; i++) { // get low and high vals for sticks and trims
int16_t vt = i<NUM_STICKS+NUM_POTS+NUM_SLIDERS ? anaIn(i) : anaIn(MOUSE1+i-NUM_STICKS-NUM_POTS-NUM_SLIDERS);
int16_t vt = i<TX_VOLTAGE ? anaIn(i) : anaIn(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) {
@@ -158,7 +158,7 @@ bool menuCommonCalib(event_t event)
for (int i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_MOUSE_ANALOGS; i++) {
reusableBuffer.calib.loVals[i] = 15000;
reusableBuffer.calib.hiVals[i] = -15000;
reusableBuffer.calib.midVals[i] = i<NUM_STICKS+NUM_POTS+NUM_SLIDERS ? anaIn(i) : anaIn(MOUSE1+i-NUM_STICKS-NUM_POTS+NUM_SLIDERS);
reusableBuffer.calib.midVals[i] = i < TX_VOLTAGE ? anaIn(i) : anaIn(i+1);
if (i < NUM_XPOTS) {
reusableBuffer.calib.xpotsCalib[i].stepsCount = 0;
reusableBuffer.calib.xpotsCalib[i].lastCount = 0;
+1 -1
View File
@@ -1722,7 +1722,7 @@ void doMixerCalculations()
int16_t val;
if (g_model.thrTraceSrc > NUM_POTS+NUM_SLIDERS) {
uint8_t ch = g_model.thrTraceSrc-NUM_POTS+NUM_SLIDERS-1;
uint8_t ch = g_model.thrTraceSrc-NUM_POTS-NUM_SLIDERS-1;
val = channelOutputs[ch];
LimitData *lim = limitAddress(ch);