RPM blades

This commit is contained in:
Andre Bernet
2015-03-22 20:56:03 +04:00
parent 91f5205c4f
commit d9cc451338
5 changed files with 47 additions and 24 deletions
+1
View File
@@ -573,6 +573,7 @@ void telemetryReset()
setTelemetryValue(TELEM_PROTO_FRSKY_SPORT, ALT_FIRST_ID, 1, 1000, UNIT_METERS, 2);
setTelemetryValue(TELEM_PROTO_FRSKY_SPORT, CELLS_FIRST_ID, 2, 0x80280220, UNIT_CELLS, 0);
setTelemetryValue(TELEM_PROTO_FRSKY_SPORT, CURR_FIRST_ID, 3, 100, UNIT_AMPS, 2);
setTelemetryValue(TELEM_PROTO_FRSKY_SPORT, RPM_FIRST_ID, 5, 3600, UNIT_RPMS, 0);
#endif
}
+3
View File
@@ -256,6 +256,9 @@ void frskySportSetDefault(int index, uint16_t id, uint8_t instance)
telemetrySensor.custom.ratio = 132;
telemetrySensor.filter = 1;
}
if (unit == UNIT_RPMS) {
telemetrySensor.custom.ratio = 1;
}
}
else {
telemetrySensor.init(id);
+3
View File
@@ -141,6 +141,9 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t newVal, uin
datetime.timestate = 1;
newVal = 0;
}
else if (unit == UNIT_RPMS) {
newVal = newVal / sensor.custom.ratio;
}
else {
newVal = sensor.getValue(newVal, unit, prec);
if (sensor.autoOffset) {