diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index f6407420a3..a7e6472e89 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -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 diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index 1c10ba64af..f20d2e1306 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -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) : #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); } diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index 2220b664d4..c214c175c4 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -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