ArduCopter: 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 47455f12db
commit 3a3433cad2
6 changed files with 7 additions and 10 deletions

View File

@ -42,7 +42,6 @@
//#define MODE_THROW_ENABLED DISABLED // disable throw mode support
//#define MODE_ZIGZAG_ENABLED DISABLED // disable zigzag mode support
//#define OSD_ENABLED DISABLED // disable on-screen-display support
//#define BUTTON_ENABLED DISABLED // disable button support
//#define LANDING_GEAR_ENABLED DISABLED // disable landing gear support
// features below are disabled by default on all boards

View File

@ -199,7 +199,7 @@ const AP_Scheduler::Task Copter::scheduler_tasks[] = {
#ifdef USERHOOK_SUPERSLOWLOOP
SCHED_TASK(userhook_SuperSlowLoop, 1, 75),
#endif
#if BUTTON_ENABLED == ENABLED
#if HAL_BUTTON_ENABLED
SCHED_TASK_CLASS(AP_Button, &copter.button, update, 5, 100),
#endif
#if STATS_ENABLED == ENABLED

View File

@ -136,7 +136,7 @@
#if CAMERA == ENABLED
# include <AP_Camera/AP_Camera.h>
#endif
#if BUTTON_ENABLED == ENABLED
#if HAL_BUTTON_ENABLED
# include <AP_Button/AP_Button.h>
#endif

View File

@ -776,7 +776,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @User: Standard
AP_GROUPINFO("WP_NAVALT_MIN", 1, ParametersG2, wp_navalt_min, 0),
#if BUTTON_ENABLED == ENABLED
#if HAL_BUTTON_ENABLED
// @Group: BTN_
// @Path: ../libraries/AP_Button/AP_Button.cpp
AP_SUBGROUPPTR(button_ptr, "BTN_", 2, ParametersG2, AP_Button),
@ -1117,7 +1117,9 @@ ParametersG2::ParametersG2(void)
#if MODE_AUTOROTATE_ENABLED == ENABLED
,arot()
#endif
#if HAL_BUTTON_ENABLED
,button_ptr(&copter.button)
#endif
#if MODE_ZIGZAG_ENABLED == ENABLED
,mode_zigzag_ptr(&copter.mode_zigzag)
#endif

View File

@ -493,7 +493,9 @@ public:
AP_Float wp_navalt_min;
// button checking
#if HAL_BUTTON_ENABLED
AP_Button *button_ptr;
#endif
#if STATS_ENABLED == ENABLED
// vehicle statistics

View File

@ -363,12 +363,6 @@
# define BEACON_ENABLED !HAL_MINIMIZE_FEATURES
#endif
//////////////////////////////////////////////////////////////////////////////
// Button - Enable the button connected to AUX1-6
#ifndef BUTTON_ENABLED
# define BUTTON_ENABLED ENABLED
#endif
//////////////////////////////////////////////////////////////////////////////
// Landing Gear support
#ifndef LANDING_GEAR_ENABLED