Skip to content

Commit

Permalink
Alt display improvements / bugfix / memory savings
Browse files Browse the repository at this point in the history
1 - Improved display
GPS alt  = ALT ::
BARO alt = ALT:

For accuracy / LIDAR, when below Hi Res cutoff
BARO ALT = AGL :

2 - display bugfix
GPS altitude could only be displayed if Baro altitude was displayed.
How as anyone never raised this !!!

3 - Memeory saving
10 bytes
  • Loading branch information
ShikOfTheRa committed Mar 27, 2020
1 parent 9c14b97 commit a703f88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 4 additions & 2 deletions MW_OSD/MW_OSD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,10 @@ void loop()
}
#endif // SUBMERSIBLE

displayAltitude(((int32_t)GPS_altitude*10),MwGPSAltPosition,SYM_GPS_ALT);
displayAltitude(MwAltitude/10,MwAltitudePosition,SYM_ALT);
if (fieldIsVisible(MwGPSAltPosition))
displayAltitude(((int32_t)GPS_altitude*10),MwGPSAltPosition,SYM_GPS_ALT);
if (fieldIsVisible(MwAltitudePosition))
displayAltitude(MwAltitude/10,MwAltitudePosition,SYM_ALT);
displayClimbRate();
displayVario();
displayNumberOfSat();
Expand Down
13 changes: 11 additions & 2 deletions MW_OSD/Screen.ino
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ void displayIntro(void)


void displayAltitude(int32_t t_alt10, int16_t t_pos, uint8_t t_icon) { // alt sent as dm
uint8_t t_dp = 0;
#if defined SUBMARINE
t_alt10 = abs(t_alt10);
#endif // SUBMARINE
Expand All @@ -884,14 +885,22 @@ void displayAltitude(int32_t t_alt10, int16_t t_pos, uint8_t t_icon) { // alt se
return;
}
}
if (!fieldIsVisible(MwAltitudePosition))
return;
if (t_alt < Settings[S_ALTRESOLUTION]) {
t_dp = 1;
if (t_icon==SYM_ALT){
t_icon = SYM_AGL;
}
}
displayItem(t_pos, t_alt, t_icon, UnitsIcon[Settings[S_UNITSYSTEM] + 0], t_dp );

/*
if (t_alt < Settings[S_ALTRESOLUTION]) {
displayItem(t_pos, t_alt10, SYM_AGL, UnitsIcon[Settings[S_UNITSYSTEM] + 0], 1 );
}
else {
displayItem(t_pos, t_alt, t_icon, UnitsIcon[Settings[S_UNITSYSTEM] + 0], 0 );
}
*/
}


Expand Down

0 comments on commit a703f88

Please sign in to comment.