feat(radio): modify Sensor Edit screens to show Ratio + Percentage (#4649)
This commit is contained in:
@@ -234,10 +234,15 @@ void menuModelSensor(event_t event)
|
||||
else {
|
||||
lcdDrawTextAlignedLeft(y, STR_RATIO);
|
||||
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 0, 30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
|
||||
if (sensor->custom.ratio == 0)
|
||||
if (sensor->custom.ratio == 0) {
|
||||
lcdDrawChar(SENSOR_2ND_COLUMN, y, '-', attr);
|
||||
else
|
||||
} else { // Ratio + Ratio Percent
|
||||
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr|PREC1);
|
||||
uint32_t ratio = (sensor->custom.ratio * 1000) / 255;
|
||||
int ratio_len = countDigits(ratio);
|
||||
lcdDrawNumber(SENSOR_3RD_COLUMN, y, ratio, LEFT|PREC1);
|
||||
lcdDrawChar(SENSOR_3RD_COLUMN+(FWNUM*ratio_len)+3, y, '%', 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user