1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

Assume CURVES are always defined

This commit is contained in:
Arne Schwabe 2018-07-05 10:40:21 +02:00
parent e76d1d0c3d
commit cbf60380f2
12 changed files with 0 additions and 41 deletions

View file

@ -121,7 +121,6 @@ void menuModelExpoOne(event_t event)
ed->offset = GVAR_MENU_ITEM(EXPO_ONE_2ND_COLUMN, y, ed->offset, -100, 100, RIGHT | attr, 0, event);
break;
#if defined(CURVES)
case EXPO_FIELD_CURVE_LABEL:
lcdDrawTextAlignedLeft(y, STR_CURVE);
break;
@ -129,7 +128,6 @@ void menuModelExpoOne(event_t event)
case EXPO_FIELD_CURVE:
editCurveRef(EXPO_ONE_2ND_COLUMN, y, ed->curve, s_editMode > 0 ? event : 0, RIGHT | attr);
break;
#endif
#if defined(FLIGHT_MODES)
case EXPO_FIELD_FLIGHT_MODES_LABEL:

View file

@ -263,7 +263,6 @@ void menuModelExpoOne(event_t event)
}
break;
#if defined(CURVES)
case EXPO_FIELD_CURVE:
lcdDrawTextAlignedLeft(y, STR_CURVE);
if (ed->curveMode!=MODE_EXPO || ed->curveParam==0) {
@ -281,7 +280,6 @@ void menuModelExpoOne(event_t event)
lcdDrawText(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_NA, attr);
}
break;
#endif
#if defined(FLIGHT_MODES)
case EXPO_FIELD_FLIGHT_MODES:
@ -385,11 +383,7 @@ void menuModelMixOne(event_t event)
putsChn(lcdLastRightPos+1*FW, 0, md2->destCh+1,0);
#if defined(ROTARY_ENCODERS)
#if defined(CURVES)
if ((menuVerticalPosition == MIX_FIELD_TRIM && md2->srcRaw > NUM_STICKS) || (menuVerticalPosition == MIX_FIELD_CURVE && md2->curveMode == MODE_CURVE))
#else
if (menuVerticalPosition == MIX_FIELD_TRIM && md2->srcRaw > NUM_STICKS)
#endif
SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, 0, CASE_CURVES(0) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/})
else
SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, 1, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/});
@ -447,7 +441,6 @@ void menuModelMixOne(event_t event)
break;
}
#if defined(CURVES)
case MIX_FIELD_CURVE:
{
drawFieldLabel(COLUMN_X, y, STR_CURVE);
@ -480,7 +473,6 @@ void menuModelMixOne(event_t event)
}
break;
}
#endif
#if defined(FLIGHT_MODES)
case MIX_FIELD_FLIGHT_PHASE:
md2->flightModes = editFlightModes(COLUMN_X+MIXES_2ND_COLUMN, y, event, md2->flightModes, attr);

View file

@ -137,12 +137,10 @@ void menuModelMixOne(event_t event)
if (attr) md2->carryTrim = !checkIncDecModel(event, !md2->carryTrim, 0, 1);
break;
#if defined(CURVES)
case MIX_FIELD_CURVE:
lcdDrawTextAlignedLeft(y, STR_CURVE);
editCurveRef(MIXES_2ND_COLUMN, y, md2->curve, event, attr);
break;
#endif
#if defined(FLIGHT_MODES)
case MIX_FIELD_FLIGHT_MODE:

View file

@ -128,12 +128,10 @@ void menuModelExpoOne(event_t event)
ed->offset = GVAR_MENU_ITEM(EXPO_ONE_2ND_COLUMN, y, ed->offset, -100, 100, LEFT|attr, 0, event);
break;
#if defined(CURVES)
case EXPO_FIELD_CURVE:
lcdDrawTextAlignedLeft(y, STR_CURVE);
editCurveRef(EXPO_ONE_2ND_COLUMN, y, ed->curve, event, attr);
break;
#endif
#if defined(FLIGHT_MODES)
case EXPO_FIELD_FLIGHT_MODES:

View file

@ -138,12 +138,10 @@ void menuModelMixOne(event_t event)
}
break;
#if defined(CURVES)
case MIX_FIELD_CURVE:
lcdDrawTextAlignedLeft(y, STR_CURVE);
editCurveRef(MIXES_2ND_COLUMN, y, md2->curve, event, attr);
break;
#endif
#if defined(FLIGHT_MODES)
case MIX_FIELD_FLIGHT_MODE:

View file

@ -26,9 +26,7 @@ enum LimitsItems {
ITEM_LIMITS_MIN,
ITEM_LIMITS_MAX,
ITEM_LIMITS_DIRECTION,
#if defined(CURVES)
ITEM_LIMITS_CURVE,
#endif
#if defined(PPM_CENTER_ADJUSTABLE)
ITEM_LIMITS_PPM_CENTER,
#endif
@ -208,7 +206,6 @@ void menuModelLimits(event_t event)
break;
}
#if defined(CURVES)
case ITEM_LIMITS_CURVE:
drawCurveName(LIMITS_CURVE_POS, y, ld->curve, attr);
if (attr && event==EVT_KEY_LONG(KEY_ENTER) && ld->curve>0) {
@ -219,7 +216,6 @@ void menuModelLimits(event_t event)
CHECK_INCDEC_MODELVAR(event, ld->curve, -MAX_CURVES, +MAX_CURVES);
}
break;
#endif
#if defined(PPM_CENTER_ADJUSTABLE)
case ITEM_LIMITS_PPM_CENTER:

View file

@ -267,12 +267,10 @@ bool menuModelExpoOne(event_t event)
ed->offset = GVAR_MENU_ITEM(EXPO_ONE_2ND_COLUMN, y, ed->offset, -100, 100, LEFT|attr, 0, event);
break;
#if defined(CURVES)
case EXPO_FIELD_CURVE:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_CURVE);
editCurveRef(EXPO_ONE_2ND_COLUMN, y, ed->curve, event, attr);
break;
#endif
#if defined(FLIGHT_MODES)
case EXPO_FIELD_FLIGHT_MODES:

View file

@ -228,12 +228,10 @@ bool menuModelMixOne(event_t event)
drawCheckBox(MIXES_2ND_COLUMN, y, !md2->carryTrim, attr);
if (attr) md2->carryTrim = !checkIncDecModel(event, !md2->carryTrim, 0, 1);
break;
#if defined(CURVES)
case MIX_FIELD_CURVE:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_CURVE);
editCurveRef(MIXES_2ND_COLUMN, y, md2->curve, event, attr);
break;
#endif
#if defined(FLIGHT_MODES)
case MIX_FIELD_FLIGHT_MODE:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_FLMODE);

View file

@ -26,9 +26,7 @@ enum LimitsItems {
ITEM_LIMITS_MIN,
ITEM_LIMITS_MAX,
ITEM_LIMITS_DIRECTION,
#if defined(CURVES)
ITEM_LIMITS_CURVE,
#endif
#if defined(PPM_CENTER_ADJUSTABLE)
ITEM_LIMITS_PPM_CENTER,
#endif
@ -197,7 +195,6 @@ bool menuModelLimits(event_t event)
break;
}
#if defined(CURVES)
case ITEM_LIMITS_CURVE:
drawCurveName(LIMITS_CURVE_POS, y, ld->curve, attr);
if (attr && event==EVT_KEY_LONG(KEY_ENTER) && ld->curve>0) {
@ -208,7 +205,6 @@ bool menuModelLimits(event_t event)
CHECK_INCDEC_MODELVAR(event, ld->curve, -MAX_CURVES, +MAX_CURVES);
}
break;
#endif
#if defined(PPM_CENTER_ADJUSTABLE)
case ITEM_LIMITS_PPM_CENTER:

View file

@ -244,7 +244,6 @@ int16_t applyLimits(uint8_t channel, int32_t value)
{
LimitData * lim = limitAddress(channel);
#if defined(CPUARM) && defined(CURVES)
if (lim->curve) {
// TODO we loose precision here, applyCustomCurve could work with int32_t on ARM boards...
if (lim->curve > 0)
@ -252,7 +251,6 @@ int16_t applyLimits(uint8_t channel, int32_t value)
else
value = 256 * applyCustomCurve(-value/256, -lim->curve-1);
}
#endif
int16_t ofs = LIMIT_OFS_RESX(lim);
int16_t lim_p = LIMIT_MAX_RESX(lim);

View file

@ -166,11 +166,7 @@
#define CASE_FLIGHT_MODES(x)
#endif
#if defined(CURVES)
#define CASE_CURVES(x) x,
#else
#define CASE_CURVES(x)
#endif
#if defined(GVARS)
#define CASE_GVARS(x) x,
@ -974,10 +970,6 @@ struct point_t
coord_t y;
};
point_t getPoint(uint8_t i);
#if !defined(CURVES)
#define LOAD_MODEL_CURVES()
#define applyCurve(x, idx) (x)
#else
typedef CurveData CurveInfo;
void loadCurves();
#define LOAD_MODEL_CURVES() loadCurves()
@ -988,7 +980,6 @@ int applyCurrentCurve(int x);
int8_t getCurveX(int noPoints, int point);
void resetCustomCurveX(int8_t * points, int noPoints);
bool moveCurve(uint8_t index, int8_t shift); // TODO bool?
#endif
#define APPLY_EXPOS_EXTRA_PARAMS_INC , uint8_t ovwrIdx=0, int16_t ovwrValue=0
#define APPLY_EXPOS_EXTRA_PARAMS , uint8_t ovwrIdx, int16_t ovwrValue

View file

@ -100,7 +100,6 @@ void clearCurves()
memclear(g_model.curves, sizeof(g_model.curves) + sizeof(g_model.points)); // clear all curves
}
#if defined(CURVES)
void setCurve(uint8_t c, const pm_int8_t ar[])
{
int8_t * cv = curveAddress(c);
@ -108,7 +107,6 @@ void setCurve(uint8_t c, const pm_int8_t ar[])
cv[i] = pgm_read_byte(&ar[i]);
}
}
#endif
void setLogicalSwitch(uint8_t idx, uint8_t func, int8_t v1, int8_t v2)
{