Better rendering when no fix is present
This commit is contained in:
parent
586b524625
commit
a0814fd5d1
|
|
@ -240,12 +240,21 @@ void _ui_drawMenuGPS(ui_state_t* ui_state)
|
||||||
// Print "GPS" on top bar
|
// Print "GPS" on top bar
|
||||||
gfx_print(layout.top_pos, "GPS", layout.top_font,
|
gfx_print(layout.top_pos, "GPS", layout.top_font,
|
||||||
TEXT_ALIGN_CENTER, color_white);
|
TEXT_ALIGN_CENTER, color_white);
|
||||||
// Print GPS status
|
// Print GPS status, if no fix, hide details
|
||||||
|
if (last_state.gps_data.fix_quality == 0)
|
||||||
|
{
|
||||||
|
point_t fix_pos = {layout.line2_pos.x, SCREEN_HEIGHT * 2 / 5};
|
||||||
|
gfx_print(fix_pos, "No Fix", layout.line3_font, TEXT_ALIGN_CENTER,
|
||||||
|
color_white);
|
||||||
|
} else if (last_state.gps_data.fix_quality == 6)
|
||||||
|
{
|
||||||
|
point_t fix_pos = {layout.line2_pos.x, SCREEN_HEIGHT * 2 / 5};
|
||||||
|
gfx_print(fix_pos, "Fix Lost", layout.line3_font, TEXT_ALIGN_CENTER,
|
||||||
|
color_white);
|
||||||
|
} else
|
||||||
|
{
|
||||||
switch(last_state.gps_data.fix_quality)
|
switch(last_state.gps_data.fix_quality)
|
||||||
{
|
{
|
||||||
case 0:
|
|
||||||
fix_buf = "No fix";
|
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
fix_buf = "SPS";
|
fix_buf = "SPS";
|
||||||
break;
|
break;
|
||||||
|
|
@ -294,6 +303,7 @@ void _ui_drawMenuGPS(ui_state_t* ui_state)
|
||||||
last_state.gps_data.altitude);
|
last_state.gps_data.altitude);
|
||||||
gfx_print(layout.bottom_pos, data_buf, layout.bottom_font, TEXT_ALIGN_CENTER,
|
gfx_print(layout.bottom_pos, data_buf, layout.bottom_font, TEXT_ALIGN_CENTER,
|
||||||
color_white);
|
color_white);
|
||||||
|
}
|
||||||
// Draw compass
|
// Draw compass
|
||||||
point_t compass_pos = {layout.horizontal_pad * 2, SCREEN_HEIGHT / 2};
|
point_t compass_pos = {layout.horizontal_pad * 2, SCREEN_HEIGHT / 2};
|
||||||
gfx_drawGPScompass(compass_pos, SCREEN_WIDTH / 9, last_state.gps_data.satellites);
|
gfx_drawGPScompass(compass_pos, SCREEN_WIDTH / 9, last_state.gps_data.satellites);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue