Add multiplier to RPM sensor (Fix #1688), fix offset/ratio DSBs
This commit is contained in:
@@ -259,6 +259,7 @@ void frskySportSetDefault(int index, uint16_t id, uint8_t instance)
|
||||
}
|
||||
if (unit == UNIT_RPMS) {
|
||||
telemetrySensor.custom.ratio = 1;
|
||||
telemetrySensor.custom.offset = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -172,7 +172,7 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
|
||||
newVal = 0;
|
||||
}
|
||||
else if (unit == UNIT_RPMS) {
|
||||
newVal = newVal / sensor.custom.ratio;
|
||||
newVal = (newVal * sensor.custom.offset) / sensor.custom.ratio;
|
||||
}
|
||||
else {
|
||||
newVal = sensor.getValue(newVal, unit, prec);
|
||||
|
||||
Reference in New Issue
Block a user