x7/x9 GPS datetime fix (#5051)

* Fix x7 display in telemetry widget (only time is displayed)

* rename drawDate to a more specific name, since it is not generic
fix for x9

* Travis build fix

* Introduce time FONTSIZE_MASK macro

* Cosmetics based on Bertrand's last feedbacks
This commit is contained in:
3djc
2017-06-28 20:28:57 +02:00
committed by Bertrand Songis
parent 76ffd4fcb4
commit b7b7c48d8e
10 changed files with 31 additions and 40 deletions
+2 -2
View File
@@ -1129,11 +1129,11 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
lcdDrawSizedText(lcdLastRightPos+1, y, direction + (value>=0 ? 0 : 1), 1);
}
void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
void drawTelemScreenDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
{
if (att & DBLSIZE) {
x -= 42;
att &= ~0x0F00; // TODO constant
att &= ~FONTSIZE_MASK;
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.month, att|LEFT, 2);
+2 -1
View File
@@ -94,7 +94,8 @@
#define NO_UNIT 0x40
#if defined(CPUARM)
#define FONTSIZE(x) ((x) & 0x0700)
#define FONTSIZE_MASK 0x0700
#define FONTSIZE(x) ((x) & FONTSIZE_MASK)
#define TINSIZE 0x0100
#define SMLSIZE 0x0200
#define MIDSIZE 0x0300
+4 -1
View File
@@ -355,7 +355,10 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
att |= INVERS|BLINK;
}
}
drawSourceValue(pos[j+1]-2, (i==3 ? 1+FH+2*FH*i:FH+2*FH*i), field, att);
if(isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME))
drawSourceValue(pos[j+1]-36, 6+FH+2*FH*i, field, SMLSIZE|NO_UNIT);
else
drawSourceValue(pos[j+1]-2, (i==3 ? 1+FH+2*FH*i:FH+2*FH*i), field, att);
}
}
}