From 3c19312c56f5273bfbe631d430e68a0278ed1ab8 Mon Sep 17 00:00:00 2001 From: yaapu Date: Fri, 15 Nov 2024 15:34:08 +0000 Subject: [PATCH] Ap_Frsky_Telem: fix for apparent wind passthrough telemetry frame --- libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp b/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp index 2621276130..c6e69d626c 100644 --- a/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp +++ b/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp @@ -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 @@ -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; }