Fixes #1352
This commit is contained in:
@@ -2749,8 +2749,16 @@ void deleteExpoMix(uint8_t expo, uint8_t idx)
|
||||
pauseMixerCalculations();
|
||||
if (expo) {
|
||||
ExpoData *expo = expoAddress(idx);
|
||||
#if defined(PCBTARANIS)
|
||||
int input = expo->chn;
|
||||
#endif
|
||||
memmove(expo, expo+1, (MAX_EXPOS-(idx+1))*sizeof(ExpoData));
|
||||
memclear(&g_model.expoData[MAX_EXPOS-1], sizeof(ExpoData));
|
||||
#if defined(PCBTARANIS)
|
||||
if (!isInputAvailable(input)) {
|
||||
memclear(&g_model.inputNames[input], sizeof(LEN_INPUT_NAME));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
MixData *mix = mixAddress(idx);
|
||||
|
||||
+15
-9
@@ -1366,20 +1366,26 @@ void drawStatusLine()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
bool isInputAvailable(int input)
|
||||
{
|
||||
for (int i=0; i<MAX_EXPOS; i++) {
|
||||
ExpoData * expo = expoAddress(i);
|
||||
if (!EXPO_VALID(expo))
|
||||
break;
|
||||
if (expo->chn == input)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isSourceAvailable(int source)
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
if (source>=MIXSRC_FIRST_INPUT && source<=MIXSRC_LAST_INPUT) {
|
||||
int input = source - MIXSRC_FIRST_INPUT;
|
||||
for (int i=0; i<MAX_EXPOS; i++) {
|
||||
ExpoData * expo = expoAddress(i);
|
||||
if (!EXPO_VALID(expo))
|
||||
break;
|
||||
if (expo->chn == input)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return isInputAvailable(source - MIXSRC_FIRST_INPUT);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -236,6 +236,7 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isInputAvailable(int input);
|
||||
bool isSourceAvailable(int source);
|
||||
bool isTelemetrySourceAvailable(int source);
|
||||
bool isInputSourceAvailable(int source);
|
||||
|
||||
Reference in New Issue
Block a user