feat(timer): Long timer announces minutes only when gt 10 minutes (#1891)

* Long timer announce minutes only
* fix: Typo and minor formatting
* fix: Handle negative long timer also + minor formatting
This commit is contained in:
eshifri
2022-07-15 12:58:16 +10:00
committed by GitHub
parent 7cff5ef97a
commit 755365abfd
16 changed files with 360 additions and 271 deletions
+9 -8
View File
@@ -75,15 +75,16 @@ PLAY_FUNCTION(playValue, source_t idx)
PLAY_NUMBER(val, telemetrySensor.unit == UNIT_CELLS ? UNIT_VOLTS : telemetrySensor.unit, attr);
}
else if (idx >= MIXSRC_FIRST_TIMER && idx <= MIXSRC_LAST_TIMER) {
PLAY_DURATION(val, 0);
}
else if (idx == MIXSRC_TX_TIME) {
PLAY_DURATION(val*60, PLAY_TIME);
}
else if (idx == MIXSRC_TX_VOLTAGE) {
int flag = 0;
if (val > LONG_TIMER_DURATION || -val > LONG_TIMER_DURATION) {
flag = PLAY_LONG_TIMER;
}
PLAY_DURATION(val, flag);
} else if (idx == MIXSRC_TX_TIME) {
PLAY_DURATION(val * 60, PLAY_TIME);
} else if (idx == MIXSRC_TX_VOLTAGE) {
PLAY_NUMBER(val, UNIT_VOLTS, PREC1);
}
else {
} else {
if (idx <= MIXSRC_LAST_CH) {
val = calcRESXto100(val);
}