Browse Source

AP_Frsky_Telem: simplified set_is_flying and moved to header file

master
Florent Martel 8 years ago committed by Tom Pittenger
parent
commit
75905be376
  1. 9
      libraries/AP_Frsky_Telem/AP_Frsky_Telem.cpp
  2. 4
      libraries/AP_Frsky_Telem/AP_Frsky_Telem.h

9
libraries/AP_Frsky_Telem/AP_Frsky_Telem.cpp

@ -889,12 +889,3 @@ void AP_Frsky_Telem::calc_gps_position(void) @@ -889,12 +889,3 @@ void AP_Frsky_Telem::calc_gps_position(void)
_gps.speed_in_centimeter = 0;
}
}
void AP_Frsky_Telem::set_is_flying(bool is_flying)
{
if (is_flying) {
_ap.value &= ~AP_LANDCOMPLETE_FLAG; // set land_complete flag to 0
} else {
_ap.value |= AP_LANDCOMPLETE_FLAG; // set land_complete flag to 1
}
}

4
libraries/AP_Frsky_Telem/AP_Frsky_Telem.h

@ -124,7 +124,9 @@ public: @@ -124,7 +124,9 @@ public:
void update_control_mode(uint8_t mode) { _ap.control_mode = mode; }
// update whether we're flying (used for Plane)
void set_is_flying(bool is_flying);
// set land_complete flag to 0 if is_flying
// set land_complete flag to 1 if not flying
void set_is_flying(bool is_flying) { (is_flying) ? (_ap.value &= ~AP_LANDCOMPLETE_FLAG) : (_ap.value |= AP_LANDCOMPLETE_FLAG); }
// update error mask of sensors and subsystems. The mask uses the
// MAV_SYS_STATUS_* values from mavlink. If a bit is set then it

Loading…
Cancel
Save