mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
Fixes #1352
This commit is contained in:
parent
1febac7bf9
commit
2c6f28e422
4 changed files with 45 additions and 34 deletions
|
@ -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);
|
||||
|
|
|
@ -1366,12 +1366,9 @@ void drawStatusLine()
|
|||
}
|
||||
#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;
|
||||
bool isInputAvailable(int input)
|
||||
{
|
||||
for (int i=0; i<MAX_EXPOS; i++) {
|
||||
ExpoData * expo = expoAddress(i);
|
||||
if (!EXPO_VALID(expo))
|
||||
|
@ -1380,6 +1377,15 @@ bool isSourceAvailable(int source)
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isSourceAvailable(int source)
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
if (source>=MIXSRC_FIRST_INPUT && source<=MIXSRC_LAST_INPUT) {
|
||||
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);
|
||||
|
|
|
@ -142,6 +142,12 @@
|
|||
#define NUM_CAL_PPM 4
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define LEN_MODEL_NAME 12
|
||||
#define LEN_BITMAP_NAME 10
|
||||
#define LEN_EXPOMIX_NAME 8
|
||||
#define LEN_FP_NAME 10
|
||||
#define LEN_CHANNEL_NAME 6
|
||||
#define LEN_INPUT_NAME 4
|
||||
enum CurveType {
|
||||
CURVE_TYPE_STANDARD,
|
||||
CURVE_TYPE_CUSTOM,
|
||||
|
@ -157,10 +163,15 @@ PACK(typedef struct t_CurveInfo {
|
|||
#define NUM_POINTS 512
|
||||
#define CURVDATA CurveInfo
|
||||
#elif defined(CPUARM)
|
||||
#define LEN_MODEL_NAME 10
|
||||
#define LEN_EXPOMIX_NAME 6
|
||||
#define LEN_FP_NAME 6
|
||||
#define MAX_CURVES 16
|
||||
#define NUM_POINTS 512
|
||||
#define CURVDATA int16_t
|
||||
#else
|
||||
#define LEN_MODEL_NAME 10
|
||||
#define LEN_FP_NAME 6
|
||||
#define MAX_CURVES 8
|
||||
#define NUM_POINTS (112-MAX_CURVES)
|
||||
#define CURVDATA int8_t
|
||||
|
@ -326,7 +337,7 @@ PACK(typedef struct t_ScriptData {
|
|||
TRAINER_MODULE
|
||||
};
|
||||
#define MODELDATA_BITMAP char bitmap[LEN_BITMAP_NAME];
|
||||
#define MODELDATA_EXTRA uint8_t externalModule; uint8_t trainerMode; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][4]; uint8_t nPotsToWarn; int8_t potPosition[NUM_POTS]; uint8_t spare[2];
|
||||
#define MODELDATA_EXTRA uint8_t externalModule; uint8_t trainerMode; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t nPotsToWarn; int8_t potPosition[NUM_POTS]; uint8_t spare[2];
|
||||
#define LIMITDATA_EXTRA char name[LEN_CHANNEL_NAME]; int8_t curve;
|
||||
#define swstate_t uint16_t
|
||||
#elif defined(PCBSKY9X)
|
||||
|
@ -443,21 +454,6 @@ PACK(typedef struct t_EEGeneral {
|
|||
#define SWITCHES_DELAY_NONE (-15)
|
||||
#define HAPTIC_STRENGTH() (3+g_eeGeneral.hapticStrength)
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define LEN_MODEL_NAME 12
|
||||
#define LEN_BITMAP_NAME 10
|
||||
#define LEN_EXPOMIX_NAME 8
|
||||
#define LEN_FP_NAME 10
|
||||
#define LEN_CHANNEL_NAME 6
|
||||
#elif defined(PCBSKY9X)
|
||||
#define LEN_MODEL_NAME 10
|
||||
#define LEN_EXPOMIX_NAME 6
|
||||
#define LEN_FP_NAME 6
|
||||
#else
|
||||
#define LEN_MODEL_NAME 10
|
||||
#define LEN_FP_NAME 6
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
enum CurveRefType {
|
||||
CURVE_REF_DIFF,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue