add distance display for mobile stations
This commit is contained in:
@@ -428,6 +428,11 @@ void drawStationScreen(int idx) {
|
|||||||
float kmh = s.speed * 1.852;
|
float kmh = s.speed * 1.852;
|
||||||
snprintf(sp, sizeof(sp), "Speed: %.0f km/h", kmh);
|
snprintf(sp, sizeof(sp), "Speed: %.0f km/h", kmh);
|
||||||
u8g2.drawUTF8(2, y, sp);
|
u8g2.drawUTF8(2, y, sp);
|
||||||
|
|
||||||
|
char di[16];
|
||||||
|
snprintf(di, sizeof(di), "Dist: %.1f km", s.distance);
|
||||||
|
int dw = u8g2.getUTF8Width(di);
|
||||||
|
u8g2.drawUTF8(126 - dw, y, di);
|
||||||
} else if (s.comment.length() > 0) {
|
} else if (s.comment.length() > 0) {
|
||||||
String c = s.comment;
|
String c = s.comment;
|
||||||
if (u8g2.getUTF8Width(c.c_str()) > 124) {
|
if (u8g2.getUTF8Width(c.c_str()) > 124) {
|
||||||
|
|||||||
Reference in New Issue
Block a user