Merge pull request #5161 from opentx/3djc/Timer-name-handling

Timer name handling
This commit is contained in:
3djc
2017-08-15 17:27:16 +02:00
committed by GitHub
3 changed files with 28 additions and 3 deletions
+9 -1
View File
@@ -914,9 +914,17 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
else if (idx <= MIXSRC_LAST_GVAR) {
drawStringWithIndex(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
}
else if (idx < MIXSRC_FIRST_TELEM) {
else if (idx < MIXSRC_FIRST_TIMER) {
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-MAX_LOGICAL_SWITCHES-MAX_TRAINER_CHANNELS-MAX_OUTPUT_CHANNELS-MAX_GVARS, att);
}
else if (idx <= MIXSRC_LAST_TIMER) {
if(ZEXIST(g_model.timers[idx-MIXSRC_FIRST_TIMER].name)) {
lcdDrawSizedText(x, y, g_model.timers[idx-MIXSRC_FIRST_TIMER].name, LEN_TIMER_NAME, ZCHAR|att);
}
else {
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-MAX_LOGICAL_SWITCHES-MAX_TRAINER_CHANNELS-MAX_OUTPUT_CHANNELS-MAX_GVARS, att);
}
}
else {
idx -= MIXSRC_FIRST_TELEM;
div_t qr = div(idx, 3);