Partly fixes #1861

This commit is contained in:
bsongis
2014-11-22 19:23:42 +01:00
parent ed6811ffce
commit 978e9a260c
6 changed files with 31 additions and 17 deletions
+6 -1
View File
@@ -445,7 +445,7 @@ int availableTelemetryIndex()
{
for (int index=0; index<TELEM_VALUES_MAX; index++) {
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index];
if (telemetrySensor.id == 0 && telemetrySensor.type == 0) {
if (!telemetrySensor.isAvailable()) {
return index;
}
}
@@ -483,6 +483,11 @@ void TelemetrySensor::init(uint16_t id)
init(label);
}
bool TelemetrySensor::isAvailable()
{
return ZLEN(label) > 0;
}
int32_t convertTelemetryValue(int32_t value, uint8_t unit, uint8_t prec, uint8_t destUnit, uint8_t destPrec)
{
for (int i=prec; i<destPrec; i++)