Do not init points to identity function to avoid issues with radio firmware

This commit is contained in:
Raphael Coeffic
2021-12-31 10:53:11 +01:00
parent 7648dfc544
commit 3eb55af228
2 changed files with 0 additions and 16 deletions
-12
View File
@@ -30,18 +30,6 @@ void CurveData::clear(int count)
{
memset(reinterpret_cast<void *>(this), 0, sizeof(CurveData));
this->count = count;
int incr = 200 / (count - 1);
// points[0].x must be -100
for (int i = 0; i < count; i++) {
if (i < count - 1)
points[i].x = -100 + incr * i;
else
points[i].x = 100; // points[last].x must be +100 do not risk a rounding issue using incr
points[i].y = points[i].x;
}
}
bool CurveData::isEmpty() const
@@ -1280,10 +1280,6 @@ class CurvesField: public TransformedField {
curve->points[j].x = *cur++;
curve->points[curve->count-1].x = +100;
}
else {
for (int j=0; j<curve->count; j++)
curve->points[j].x = -100 + (200*i) / (curve->count-1);
}
qCDebug(eepromImport) << QString("imported curve: %3 points").arg(curve->count);
}
}