This commit is contained in:
bsongis
2014-05-02 10:38:54 +02:00
parent 16c05c21b6
commit 363bc745ce
+6 -3
View File
@@ -3973,8 +3973,7 @@ void perOut(uint8_t mode, uint8_t tick10ms)
//========== CURVES =============== //========== CURVES ===============
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
// TODO something cleaner ... if (apply_offset_and_curve && md->curve.type != CURVE_REF_DIFF && md->curve.value) {
if (apply_offset_and_curve && md->curve.value) {
v = applyCurve(v, md->curve); v = applyCurve(v, md->curve);
} }
#else #else
@@ -3994,8 +3993,12 @@ void perOut(uint8_t mode, uint8_t tick10ms)
} }
#endif #endif
#if !defined(PCBTARANIS) // TODO move before WEIGHT for readability
//========== DIFFERENTIAL ========= //========== DIFFERENTIAL =========
#if defined(PCBTARANIS)
if (md->curve.type == CURVE_REF_DIFF && md->curve.value) {
dv = applyCurve(dv, md->curve);
}
#else
if (md->curveMode == MODE_DIFFERENTIAL) { if (md->curveMode == MODE_DIFFERENTIAL) {
// @@@2 also recalculate curveParam to a 256 basis which ease the calculation later a lot // @@@2 also recalculate curveParam to a 256 basis which ease the calculation later a lot
int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_phase)); int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_phase));