Browse Source

ArduPlane: add and use HAL_BUTTON_ENABLE

gps-1.3.1
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
bfe9208849
  1. 2
      ArduPlane/ArduPlane.cpp
  2. 4
      ArduPlane/Parameters.cpp
  3. 2
      ArduPlane/Parameters.h

2
ArduPlane/ArduPlane.cpp

@ -102,7 +102,9 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = { @@ -102,7 +102,9 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = {
SCHED_TASK(avoidance_adsb_update, 10, 100),
#endif
SCHED_TASK_CLASS(RC_Channels, (RC_Channels*)&plane.g2.rc_channels, read_aux_all, 10, 200),
#if HAL_BUTTON_ENABLED
SCHED_TASK_CLASS(AP_Button, &plane.button, update, 5, 100),
#endif
#if STATS_ENABLED == ENABLED
SCHED_TASK_CLASS(AP_Stats, &plane.g2.stats, update, 1, 100),
#endif

4
ArduPlane/Parameters.cpp

@ -1033,9 +1033,11 @@ const AP_Param::Info Plane::var_info[] = { @@ -1033,9 +1033,11 @@ const AP_Param::Info Plane::var_info[] = {
*/
const AP_Param::GroupInfo ParametersG2::var_info[] = {
#if HAL_BUTTON_ENABLED
// @Group: BTN_
// @Path: ../libraries/AP_Button/AP_Button.cpp
AP_SUBGROUPPTR(button_ptr, "BTN_", 1, ParametersG2, AP_Button),
#endif
// @Group: ICE_
// @Path: ../libraries/AP_ICEngine/AP_ICEngine.cpp
@ -1262,7 +1264,9 @@ ParametersG2::ParametersG2(void) : @@ -1262,7 +1264,9 @@ ParametersG2::ParametersG2(void) :
#if HAL_SOARING_ENABLED
,soaring_controller(plane.TECS_controller, plane.aparm)
#endif
#if HAL_BUTTON_ENABLED
,button_ptr(&plane.button)
#endif
{
AP_Param::setup_object_defaults(this, var_info);
}

2
ArduPlane/Parameters.h

@ -489,7 +489,9 @@ public: @@ -489,7 +489,9 @@ public:
static const struct AP_Param::GroupInfo var_info[];
// button reporting library
#if HAL_BUTTON_ENABLED
AP_Button *button_ptr;
#endif
#if STATS_ENABLED == ENABLED
// vehicle statistics

Loading…
Cancel
Save