ArduPlane: add and use HAL_BUTTON_ENABLE

This commit is contained in:
Peter Barker 2021-08-12 13:38:21 +10:00 committed by Andrew Tridgell
parent 3a3433cad2
commit bfe9208849
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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