mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
ArduCopter: allow MAV_CMD_SOLO_BTN_PAUSE_CLICK as COMMAND_INT
This commit is contained in:
parent
d10cebd649
commit
b725a632d6
@ -756,6 +756,12 @@ MAV_RESULT GCS_MAVLINK_Copter::handle_command_int_packet(const mavlink_command_i
|
||||
case MAV_CMD_DO_PAUSE_CONTINUE:
|
||||
return handle_command_pause_continue(packet);
|
||||
|
||||
#if AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
||||
// Solo user presses pause button
|
||||
case MAV_CMD_SOLO_BTN_PAUSE_CLICK:
|
||||
return handle_MAV_CMD_SOLO_BTN_PAUSE_CLICK(packet);
|
||||
#endif
|
||||
|
||||
default:
|
||||
return GCS_MAVLINK::handle_command_int_packet(packet, msg);
|
||||
}
|
||||
@ -970,8 +976,14 @@ MAV_RESULT GCS_MAVLINK_Copter::handle_command_long_packet(const mavlink_command_
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
|
||||
/* Solo user presses pause button */
|
||||
case MAV_CMD_SOLO_BTN_PAUSE_CLICK: {
|
||||
default:
|
||||
return GCS_MAVLINK::handle_command_long_packet(packet, msg);
|
||||
}
|
||||
}
|
||||
|
||||
#if AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
||||
MAV_RESULT GCS_MAVLINK_Copter::handle_MAV_CMD_SOLO_BTN_PAUSE_CLICK(const mavlink_command_int_t &packet)
|
||||
{
|
||||
if (copter.failsafe.radio) {
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
@ -1001,12 +1013,8 @@ MAV_RESULT GCS_MAVLINK_Copter::handle_command_long_packet(const mavlink_command_
|
||||
}
|
||||
}
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
|
||||
default:
|
||||
return GCS_MAVLINK::handle_command_long_packet(packet, msg);
|
||||
}
|
||||
}
|
||||
#endif // AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
||||
|
||||
MAV_RESULT GCS_MAVLINK_Copter::handle_command_pause_continue(const mavlink_command_int_t &packet)
|
||||
{
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
#include <GCS_MAVLink/GCS.h>
|
||||
|
||||
#ifndef AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
||||
#define AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED 1
|
||||
#endif
|
||||
|
||||
class GCS_MAVLINK_Copter : public GCS_MAVLINK
|
||||
{
|
||||
|
||||
@ -91,4 +95,10 @@ private:
|
||||
uint8_t high_latency_wind_speed() const override;
|
||||
uint8_t high_latency_wind_direction() const override;
|
||||
#endif // HAL_HIGH_LATENCY2_ENABLED
|
||||
|
||||
|
||||
#if AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
||||
MAV_RESULT handle_MAV_CMD_SOLO_BTN_PAUSE_CLICK(const mavlink_command_int_t &packet);
|
||||
#endif
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user