Skip to content

Commit

Permalink
Ap_Frsky_Telem: fix for apparent wind passthrough telemetry frame
Browse files Browse the repository at this point in the history
  • Loading branch information
yaapu committed Nov 15, 2024
1 parent a69b777 commit 0bf7593
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ for FrSky SPort Passthrough
#define WIND_ANGLE_LIMIT 0x7F
#define WIND_SPEED_OFFSET 7
#define WIND_APPARENT_ANGLE_OFFSET 15
#define WIND_APPARENT_SPEED_OFFSET 23
#define WIND_APPARENT_SPEED_OFFSET 22
// for waypoint data
#define WP_NUMBER_LIMIT 2047
#define WP_DISTANCE_LIMIT 1023000
Expand Down Expand Up @@ -781,7 +781,7 @@ uint32_t AP_Frsky_SPort_Passthrough::calc_wind(void)
// true wind speed in dm/s
value |= prep_number(roundf(windvane->get_true_wind_speed() * 10), 2, 1) << WIND_SPEED_OFFSET;
// apparent wind angle in 3 degree increments -180,180 (signed)
value |= prep_number(roundf(degrees(windvane->get_apparent_wind_direction_rad()) * (1.0f/3.0f)), 2, 0);
value |= prep_number(roundf(degrees(windvane->get_apparent_wind_direction_rad()) * (1.0f/3.0f)), 2, 0) << WIND_APPARENT_ANGLE_OFFSET;
// apparent wind speed in dm/s
value |= prep_number(roundf(windvane->get_apparent_wind_speed() * 10), 2, 1) << WIND_APPARENT_SPEED_OFFSET;
}
Expand Down

0 comments on commit 0bf7593

Please sign in to comment.