Fixes #1655
This commit is contained in:
@@ -3167,12 +3167,13 @@ void menuModelExpoOne(uint8_t event)
|
||||
if (ed->srcRaw >= MIXSRC_FIRST_TELEM) {
|
||||
putsTelemetryChannel(LCD_W-8, 6*FH, ed->srcRaw - MIXSRC_FIRST_TELEM, x512, 0);
|
||||
if (ed->scale > 0) x512 = (x512 * 1024) / convertTelemValue(ed->srcRaw - MIXSRC_FIRST_TELEM + 1, ed->scale);
|
||||
x512 = limit(-1024, x512, 1024);
|
||||
}
|
||||
else {
|
||||
lcd_outdezAtt(LCD_W-8, 6*FH, calcRESXto1000(x512), PREC1);
|
||||
}
|
||||
x512 = limit(-1024, x512, 1024);
|
||||
int y512 = expoFn(x512);
|
||||
y512 = limit(-1024, y512, 1024);
|
||||
lcd_outdezAtt(LCD_W-8-6*FW, 1*FH, calcRESXto1000(y512), PREC1);
|
||||
#else
|
||||
int16_t x512 = calibratedStick[ed->chn];
|
||||
@@ -3181,10 +3182,11 @@ void menuModelExpoOne(uint8_t event)
|
||||
lcd_outdezAtt(LCD_W-8-6*FW, 1*FH, calcRESXto100(y512), 0);
|
||||
#endif
|
||||
|
||||
x512 = X0+x512/(RESXu/WCHART);
|
||||
#if defined(CPUARM)
|
||||
x512 = X0+x512/(RESX/WCHART);
|
||||
y512 = (LCD_H-1) - ((y512+RESX)/2) * (LCD_H-1) / RESX;
|
||||
#else
|
||||
x512 = X0+x512/(RESXu/WCHART);
|
||||
y512 = (LCD_H-1) - (uint16_t)((y512+RESX)/2) * (LCD_H-1) / RESX;
|
||||
#endif
|
||||
|
||||
|
||||
+2
-1
@@ -106,8 +106,9 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS)
|
||||
else {
|
||||
v = getValue(ed->srcRaw);
|
||||
if (ed->srcRaw >= MIXSRC_FIRST_TELEM && ed->scale > 0) {
|
||||
v = limit(-1024, int((v * 1024) / convertTelemValue(ed->srcRaw-MIXSRC_FIRST_TELEM+1, ed->scale)), 1024);
|
||||
v = (v * 1024) / convertTelemValue(ed->srcRaw-MIXSRC_FIRST_TELEM+1, ed->scale);
|
||||
}
|
||||
v = limit(-1024, v, 1024);
|
||||
}
|
||||
#else
|
||||
int16_t v = anas2[ed->chn];
|
||||
|
||||
+21
-2
@@ -467,6 +467,23 @@ void modelDefault(uint8_t id)
|
||||
g_model.mavlink.pc_rssi_en = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
bool isInputRecursive(int index)
|
||||
{
|
||||
ExpoData * line = expoAddress(0);
|
||||
for (int i=0; i<MAX_EXPOS; i++, line++) {
|
||||
if (line->chn > index)
|
||||
break;
|
||||
else if (line->chn < index)
|
||||
continue;
|
||||
else if (line->srcRaw >= MIXSRC_FIRST_LOGICAL_SWITCH)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(AUTOSOURCE)
|
||||
int8_t getMovedSource(GET_MOVED_SOURCE_PARAMS)
|
||||
{
|
||||
@@ -478,8 +495,10 @@ int8_t getMovedSource(GET_MOVED_SOURCE_PARAMS)
|
||||
if (min <= MIXSRC_FIRST_INPUT) {
|
||||
for (uint8_t i=0; i<MAX_INPUTS; i++) {
|
||||
if (abs(anas[i] - inputsStates[i]) > 512) {
|
||||
result = MIXSRC_FIRST_INPUT+i;
|
||||
break;
|
||||
if (!isInputRecursive(i)) {
|
||||
result = MIXSRC_FIRST_INPUT+i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user