Fix timer display (is DATETIME but no date available) (#5299)

This commit is contained in:
3djc
2017-10-29 08:36:30 +01:00
committed by Andre Bernet
parent 176845047d
commit 3fed1aa157
2 changed files with 9 additions and 3 deletions
+6 -2
View File
@@ -318,6 +318,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
{
// Custom Screen with numbers
uint8_t fields_count = 0;
bool isTimer = 0;
lcdDrawSolidVerticalLine(63, 8, 48);
for (uint8_t i=0; i<4; i++) {
for (uint8_t j=0; j<NUM_LINE_ITEMS; j++) {
@@ -337,6 +338,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER && i!=3) {
// there is not enough space on LCD for displaying "Tmr1" or "Tmr2" and still see the - sign, we write "T1" or "T2" instead
drawStringWithIndex(pos[j], 1+FH+2*FH*i, "T", field-MIXSRC_FIRST_TIMER+1, 0);
isTimer = 1;
}
else if (field >= MIXSRC_FIRST_TELEM && isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3) && telemetryItems[(field-MIXSRC_FIRST_TELEM)/3].isAvailable()) {
// we don't display GPS name, no space for it
@@ -355,10 +357,12 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
att |= INVERS|BLINK;
}
}
if(isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME))
if(isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME) && !isTimer) {
drawTelemScreenDate(pos[j+1]-36, 6+FH+2*FH*i, field, SMLSIZE|NO_UNIT);
else
}
else {
drawSourceValue(pos[j+1]-2, (i==3 ? 1+FH+2*FH*i:FH+2*FH*i), field, att);
}
}
}
}
+3 -1
View File
@@ -98,6 +98,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
{
// Custom Screen with numbers
const coord_t pos[] = {0, 71, 143, 214};
bool isTimer = 0;
uint8_t fields_count = 0;
lcdDrawSolidVerticalLine(69, 8, 48);
lcdDrawSolidVerticalLine(141, 8, 48);
@@ -120,6 +121,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER && i!=3) {
// there is not enough space on LCD for displaying "Tmr1" or "Tmr2" and still see the - sign, we write "T1" or "T2" instead
drawStringWithIndex(pos[j], 1+FH+2*FH*i, "T", field-MIXSRC_FIRST_TIMER+1, 0);
isTimer = 1;
if (timersStates[field-MIXSRC_FIRST_TIMER].val > 3600) {
att += TIMEHOUR - DBLSIZE;
x -= 3*FW;
@@ -144,7 +146,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
}
}
if(isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME)) {
if(isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME) && !isTimer) {
drawTelemScreenDate(x, y, field, att);
}
else {