feat: Convert PPM_UNIT build option to runtime radio setting (#3993)

This commit is contained in:
philmoz
2023-10-10 19:47:50 +10:00
committed by GitHub
parent b05044091a
commit 837677b3ef
58 changed files with 248 additions and 188 deletions
+7 -7
View File
@@ -96,13 +96,13 @@ void menuChannelsViewCommon(event_t event)
}
// Value
#if defined(PPM_UNIT_US)
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, PPM_CH_CENTER(ch) + val / 2, TINSIZE | RIGHT);
#elif defined(PPM_UNIT_PERCENT_PREC1)
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, calcRESXto1000(val), PREC1 | TINSIZE | RIGHT);
#else
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, calcRESXto1000(val) / 10, TINSIZE | RIGHT);
#endif
if (g_eeGeneral.ppmunit == PPM_US) {
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, PPM_CH_CENTER(ch) + val / 2, TINSIZE | RIGHT);
} else if (g_eeGeneral.ppmunit == PPM_PERCENT_PREC1) {
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, calcRESXto1000(val), PREC1 | TINSIZE | RIGHT);
} else {
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, calcRESXto1000(val) / 10, TINSIZE | RIGHT);
}
// Gauge
drawGauge(CHANNEL_GAUGE_OFFSET, y, CHANNEL_BAR_WIDTH, 6, val, limits);