Skip to content

Commit

Permalink
Initial, very basic implementation of OSD wind indicators
Browse files Browse the repository at this point in the history
An indicator shows the wind in the XY plane while another shows
the Z axis.
  • Loading branch information
fiam committed May 27, 2018
1 parent 9a45a0c commit e3c5882
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/drivers/max7456_symbols.h
Expand Up @@ -223,6 +223,8 @@

// Air speed
#define SYM_AIR 151
// TODO: Proper symbol
#define SYM_WIND 'W'

//Misc
#define SYM_COLON 0x2D
Expand Down
35 changes: 35 additions & 0 deletions src/main/io/osd.c
Expand Up @@ -1747,6 +1747,41 @@ static bool osdDrawSingleElement(uint8_t item)
break;
}

#if 0
case OSD_HORIZONTAL_WIND:
{
float horizontalWindSpeed;
float horizontalWindAngle;
getEstimatedWindVelocityBodyFrame(&horizontalWindSpeed, &horizontalWindAngle, NULL);
buff[0] = SYM_WIND;
int16_t h = RADIANS_TO_DEGREES(horizontalWindAngle);
if (h < 0) {
h += 360;
}
if (h >= 360) {
h -= 360;
}
h = h*2/45;
buff[1] = SYM_ARROW_UP + h;
osdFormatCentiNumber(buff + 2, horizontalWindSpeed * 0.036, 0, 2, 0, 3);
buff[5] = SYM_KMH;
buff[6] = '\0';
break;
}

case OSD_VERTICAL_WIND:
{
float verticalWindSpeed;
getEstimatedWindVelocityBodyFrame(NULL, NULL, &verticalWindSpeed);
buff[0] = SYM_WIND;
buff[1] = verticalWindSpeed > 0 ? SYM_AH_DECORATION_UP : verticalWindSpeed < 0 ? SYM_AH_DECORATION_DOWN : SYM_BLANK;
osdFormatCentiNumber(buff + 2, verticalWindSpeed * 0.036, 0, 2, 0, 3);
buff[5] = SYM_KMH;
buff[6] = '\0';
break;
}
#endif

default:
return false;
}
Expand Down

0 comments on commit e3c5882

Please sign in to comment.