1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00
This commit is contained in:
Bertrand Songis 2015-08-05 18:50:22 +02:00
parent 23e16b26f1
commit 2378080ae8
2 changed files with 7 additions and 0 deletions

View file

@ -527,6 +527,10 @@ void TelemetrySensor::init(const char * label, uint8_t unit, uint8_t prec)
memclear(this->label, TELEM_LABEL_LEN);
strncpy(this->label, label, TELEM_LABEL_LEN);
this->unit = unit;
if (prec > 1 && (IS_DISTANCE_UNIT(unit) || IS_SPEED_UNIT(unit))) {
// 2 digits precision is not needed here
prec = 1;
}
this->prec = prec;
}