Cosmetics

This commit is contained in:
Bertrand Songis
2015-03-14 10:26:05 +01:00
parent 9b6422b534
commit 74779cc525
2 changed files with 62 additions and 59 deletions
+5 -8
View File
@@ -36,7 +36,7 @@
#include "opentx.h"
#if defined(PCBTARANIS)
#if defined(XCURVES)
int8_t *curveEnd[MAX_CURVES];
void loadCurves()
{
@@ -86,7 +86,7 @@ CurveInfo curveInfo(uint8_t idx)
}
#endif
#if defined(PCBTARANIS)
#if defined(XCURVES)
#define CUSTOM_POINT_X(points, count, idx) ((idx)==0 ? -100 : (((idx)==(count)-1) ? 100 : points[(count)+(idx)-1]))
s32 compute_tangent(CurveInfo *crv, int8_t *points, int i)
{
@@ -205,7 +205,7 @@ int16_t hermite_spline(int16_t x, uint8_t idx)
int intpol(int x, uint8_t idx) // -100, -75, -50, -25, 0 ,25 ,50, 75, 100
{
#if defined(PCBTARANIS)
#if defined(XCURVES)
CurveInfo &crv = g_model.curves[idx];
int8_t *points = curveAddress(idx);
uint8_t count = crv.points+5;
@@ -248,8 +248,7 @@ int intpol(int x, uint8_t idx) // -100, -75, -50, -25, 0 ,25 ,50, 75, 100
return erg / 25; // 100*D5/RESX;
}
#if defined(CURVES)
#if defined(PCBTARANIS)
#if defined(CURVES) && defined(XCURVES)
int applyCurve(int x, CurveRef & curve)
{
switch (curve.type) {
@@ -313,8 +312,7 @@ int applyCustomCurve(int x, uint8_t idx)
else
return intpol(x, idx);
}
#else
#elif defined(CURVES)
int applyCurve(int x, int8_t idx)
{
/* already tried to have only one return at the end */
@@ -343,7 +341,6 @@ int applyCurve(int x, int8_t idx)
return applyCustomCurve(x, idx - CURVE_BASE);
}
#endif
#endif
// #define EXTENDED_EXPO
// increases range of expo curve but costs about 82 bytes flash