|
|
|
@ -19,7 +19,10 @@
@@ -19,7 +19,10 @@
|
|
|
|
|
/*
|
|
|
|
|
FRSKY Telemetry library |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#include "AP_Frsky_Telem.h" |
|
|
|
|
|
|
|
|
|
#include <AP_InertialSensor/AP_InertialSensor.h> |
|
|
|
|
#include <GCS_MAVLink/GCS.h> |
|
|
|
|
|
|
|
|
|
#include <stdio.h> |
|
|
|
@ -683,6 +686,9 @@ uint32_t AP_Frsky_Telem::calc_ap_status(void)
@@ -683,6 +686,9 @@ uint32_t AP_Frsky_Telem::calc_ap_status(void)
|
|
|
|
|
{ |
|
|
|
|
uint32_t ap_status; |
|
|
|
|
|
|
|
|
|
// IMU temperature: offset -19, 0 means temp =< 19°, 63 means temp => 82°
|
|
|
|
|
uint8_t imu_temp = (uint8_t) roundf(constrain_float(AP::ins().get_temperature(0), AP_IMU_TEMP_MIN, AP_IMU_TEMP_MAX) - AP_IMU_TEMP_MIN); |
|
|
|
|
|
|
|
|
|
// control/flight mode number (limit to 31 (0x1F) since the value is stored on 5 bits)
|
|
|
|
|
ap_status = (uint8_t)((_ap.control_mode+1) & AP_CONTROL_MODE_LIMIT); |
|
|
|
|
// simple/super simple modes flags
|
|
|
|
@ -695,6 +701,8 @@ uint32_t AP_Frsky_Telem::calc_ap_status(void)
@@ -695,6 +701,8 @@ uint32_t AP_Frsky_Telem::calc_ap_status(void)
|
|
|
|
|
ap_status |= (uint8_t)(AP_Notify::flags.failsafe_battery)<<AP_BATT_FS_OFFSET; |
|
|
|
|
// bad ekf flag
|
|
|
|
|
ap_status |= (uint8_t)(AP_Notify::flags.ekf_bad)<<AP_EKF_FS_OFFSET; |
|
|
|
|
// IMU temperature
|
|
|
|
|
ap_status |= imu_temp << AP_IMU_TEMP_OFFSET; |
|
|
|
|
return ap_status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|