mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-26 15:54:15 +01:00
LP-291 add missing includes. Uncrustification.
This commit is contained in:
parent
69a51956e8
commit
33eb434862
@ -42,6 +42,8 @@
|
||||
#include "flightbatterystate.h"
|
||||
#include "gpspositionsensor.h"
|
||||
#include "manualcontrolcommand.h"
|
||||
#include "manualcontrolsettings.h"
|
||||
#include "oplinkstatus.h"
|
||||
#include "accessorydesired.h"
|
||||
#include "attitudestate.h"
|
||||
#include "airspeedstate.h"
|
||||
@ -452,19 +454,16 @@ static void msp_send_analog(struct msp_bridge *m)
|
||||
ManualControlSettingsChannelGroupsData channelGroups;
|
||||
ManualControlSettingsChannelGroupsGet(&channelGroups);
|
||||
|
||||
if(channelGroups.Throttle == MANUALCONTROLSETTINGS_CHANNELGROUPS_OPLINK)
|
||||
{
|
||||
if (channelGroups.Throttle == MANUALCONTROLSETTINGS_CHANNELGROUPS_OPLINK) {
|
||||
int8_t rssi;
|
||||
OPLinkStatusRSSIGet(&rssi);
|
||||
|
||||
// oplink rssi - low: -127 noise floor (set by software when link is completely lost)
|
||||
// max: various articles found on web quote -10 as maximum received signal power expressed in dBm.
|
||||
// max: various articles found on web quote -10 as maximum received signal power expressed in dBm.
|
||||
// MSP values have no units, and OSD rssi display requires calibration anyway, so we will translate -127 to -10 -> 0-1023
|
||||
|
||||
data.status.rssi = ((127 + rssi) * 1023) / (127 - 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
uint8_t quality;
|
||||
ReceiverStatusQualityGet(&quality);
|
||||
|
||||
@ -539,19 +538,16 @@ static void msp_send_comp_gps(struct msp_bridge *m)
|
||||
data.comp_gps.direction_to_home = 0;
|
||||
data.comp_gps.home_position_valid = 0; // Home distance and direction will not display on OSD
|
||||
|
||||
if( PositionStateHandle() && TakeOffLocationHandle() )
|
||||
{
|
||||
|
||||
if (PositionStateHandle() && TakeOffLocationHandle()) {
|
||||
TakeOffLocationData takeOffLocation;
|
||||
TakeOffLocationGet(&takeOffLocation);
|
||||
|
||||
if(takeOffLocation.Status == TAKEOFFLOCATION_STATUS_VALID)
|
||||
{
|
||||
PositionStateData positionState;
|
||||
if (takeOffLocation.Status == TAKEOFFLOCATION_STATUS_VALID) {
|
||||
PositionStateData positionState;
|
||||
PositionStateGet(&positionState);
|
||||
|
||||
data.comp_gps.distance_to_home = (uint16_t)sqrtf( Sq(takeOffLocation.East - positionState.East) + Sq(takeOffLocation.North - positionState.North) );
|
||||
data.comp_gps.direction_to_home = RAD2DEG( atan2f(takeOffLocation.East - positionState.East, takeOffLocation.North - positionState.North) );
|
||||
data.comp_gps.distance_to_home = (uint16_t)sqrtf(Sq(takeOffLocation.East - positionState.East) + Sq(takeOffLocation.North - positionState.North));
|
||||
data.comp_gps.direction_to_home = RAD2DEG(atan2f(takeOffLocation.East - positionState.East, takeOffLocation.North - positionState.North));
|
||||
|
||||
data.comp_gps.home_position_valid = 1;
|
||||
}
|
||||
@ -568,8 +564,8 @@ static void msp_send_altitude(struct msp_bridge *m)
|
||||
union {
|
||||
uint8_t buf[0];
|
||||
struct {
|
||||
int32_t estimatedAltitude; // cm
|
||||
int16_t vario; // cm/s
|
||||
int32_t estimatedAltitude; // cm
|
||||
int16_t vario; // cm/s
|
||||
} __attribute__((packed)) altitude;
|
||||
} data;
|
||||
|
||||
@ -583,7 +579,7 @@ static void msp_send_altitude(struct msp_bridge *m)
|
||||
data.altitude.estimatedAltitude = 0;
|
||||
}
|
||||
|
||||
if( VelocityStateHandle() != NULL) {
|
||||
if (VelocityStateHandle() != NULL) {
|
||||
VelocityStateData velocityState;
|
||||
VelocityStateGet(&velocityState);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user