mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 12:38:33 -04:00
Copter: added AP_Button support
This commit is contained in:
parent
3f0a8d1761
commit
cb5ca713a9
@ -151,6 +151,7 @@ const AP_Scheduler::Task Copter::scheduler_tasks[] = {
|
||||
#ifdef USERHOOK_SUPERSLOWLOOP
|
||||
SCHED_TASK(userhook_SuperSlowLoop, 1, 75),
|
||||
#endif
|
||||
SCHED_TASK(button_update, 5, 100),
|
||||
};
|
||||
|
||||
|
||||
|
@ -88,6 +88,7 @@
|
||||
#include <AP_RPM/AP_RPM.h>
|
||||
#include <AC_InputManager/AC_InputManager.h> // Pilot input handling library
|
||||
#include <AC_InputManager/AC_InputManager_Heli.h> // Heli specific pilot input handling library
|
||||
#include <AP_Button/AP_Button.h>
|
||||
|
||||
// Configuration
|
||||
#include "defines.h"
|
||||
@ -660,6 +661,7 @@ private:
|
||||
void send_rangefinder(mavlink_channel_t chan);
|
||||
void send_rpm(mavlink_channel_t chan);
|
||||
void rpm_update();
|
||||
void button_update();
|
||||
void send_pid_tuning(mavlink_channel_t chan);
|
||||
void gcs_send_message(enum ap_message id);
|
||||
void gcs_send_mission_item_reached_message(uint16_t mission_index);
|
||||
|
@ -966,6 +966,10 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
||||
// @User: Standard
|
||||
AP_GROUPINFO("WP_TKOFF_NAV_ALT", 1, ParametersG2, takeoff_nav_alt, 0),
|
||||
|
||||
// @Group: BTN_
|
||||
// @Path: ../libraries/AP_Button/AP_Button.cpp
|
||||
AP_SUBGROUPINFO(button, "BTN_", 2, ParametersG2, AP_Button),
|
||||
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
||||
|
@ -543,6 +543,9 @@ public:
|
||||
|
||||
// altitude at which nav control can start in takeoff
|
||||
AP_Float takeoff_nav_alt;
|
||||
|
||||
// button checking
|
||||
AP_Button button;
|
||||
};
|
||||
|
||||
extern const AP_Param::Info var_info[];
|
||||
|
@ -226,3 +226,11 @@ void Copter::epm_update()
|
||||
epm.update();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
update AP_Button
|
||||
*/
|
||||
void Copter::button_update(void)
|
||||
{
|
||||
g2.button.update();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user