Curve names used instead of CV<X> when available

This commit is contained in:
Bertrand Songis
2016-01-14 23:13:26 +01:00
parent 0dd15ebbab
commit a1883db889
37 changed files with 114 additions and 108 deletions
+8 -8
View File
@@ -638,7 +638,7 @@ void putsVBat(coord_t x, coord_t y, LcdFlags att)
putsVolts(x, y, g_vbat100mV, att);
}
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att)
void drawStringWithIndex(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att)
{
lcdDrawText(x, y, str, att & ~LEADING0);
lcdDrawNumber(lcdNextPos, y, idx, att|LEFT, 2);
@@ -653,13 +653,13 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
else if (idx <= MIXSRC_LAST_LOGICAL_SWITCH)
putsSwitches(x, y, SWSRC_SW1+idx-MIXSRC_SW1, att);
else if (idx < MIXSRC_CH1)
putsStrIdx(x, y, STR_PPM_TRAINER, idx-MIXSRC_FIRST_TRAINER+1, att);
drawStringWithIndex(x, y, STR_PPM_TRAINER, idx-MIXSRC_FIRST_TRAINER+1, att);
else if (idx <= MIXSRC_LAST_CH) {
putsStrIdx(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
}
#if defined(GVARS) || !defined(PCBSTD)
else if (idx <= MIXSRC_LAST_GVAR)
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
drawStringWithIndex(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
#endif
else if (idx < MIXSRC_FIRST_TELEM) {
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-(MIXSRC_SW1-MIXSRC_THR)-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
@@ -687,7 +687,7 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
uint8_t len = sizeof(g_model.header.name);
while (len>0 && !name[len-1]) --len;
if (len==0) {
putsStrIdx(x, y, STR_MODEL, id+1, att|LEADING0);
drawStringWithIndex(x, y, STR_MODEL, id+1, att|LEADING0);
}
else {
lcdDrawSizedText(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
@@ -704,7 +704,7 @@ void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
}
#if defined(CPUARM) && defined(FLIGHT_MODES)
if (idx >= SWSRC_FIRST_FLIGHT_MODE) {
return putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att);
return drawStringWithIndex(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att);
}
#endif
return lcdDrawTextAtIndex(x, y, STR_VSWITCHES, idx, att);
@@ -718,11 +718,11 @@ void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
if (att & CONDENSED)
lcdDrawNumber(x+FW*1, y, idx-1, (att & ~CONDENSED), 1);
else
putsStrIdx(x, y, STR_FP, idx-1, att);
drawStringWithIndex(x, y, STR_FP, idx-1, att);
}
#endif
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags att)
{
if (idx < 0) {
lcdDrawChar(x-3, y, '!', att);