Copter: create generic vehicle management and move runcam to it

This commit is contained in:
Andy Piper 2019-11-10 20:13:17 +00:00 committed by Andrew Tridgell
parent 0eddc8b589
commit 93abfdb905
5 changed files with 10 additions and 3 deletions

View File

@ -49,7 +49,6 @@
//#define OSD_ENABLED DISABLED // disable on-screen-display support
//#define BUTTON_ENABLED DISABLED // disable button support
// features below are disabled by default on all boards
//#define CAL_ALWAYS_REBOOT // flight controller will reboot after compass or accelerometer calibration completes
//#define DISALLOW_GCS_MODE_CHANGE_DURING_RC_FAILSAFE // disable mode changes from GCS during Radio failsafes. Avoids a race condition for vehicle like Solo in which the RC and telemetry travel along the same link

View File

@ -623,5 +623,6 @@ Copter::Copter(void)
}
Copter copter;
AP_Vehicle& vehicle = copter;
AP_HAL_MAIN_CALLBACKS(&copter);

View File

@ -715,6 +715,10 @@ const AP_Param::Info Copter::var_info[] = {
// @Path: Parameters.cpp
GOBJECT(g2, "", ParametersG2),
// @Group:
// @Path: ../libraries/AP_Vehicle/AP_Vehicle.cpp
{ AP_PARAM_GROUP, "", Parameters::k_param_vehicle, (const void *)&copter, {group_info : AP_Vehicle::var_info} },
AP_VAREND
};
@ -959,8 +963,6 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
AP_SUBGROUPINFO(arot, "AROT_", 37, ParametersG2, AC_Autorotation),
#endif
AP_GROUPEND
};

View File

@ -373,6 +373,8 @@ public:
// 254,255: reserved
k_param_vehicle = 257, // vehicle common block of parameters
// the k_param_* space is 9-bits in size
// 511: reserved
};

View File

@ -226,6 +226,9 @@ void Copter::init_ardupilot()
g2.smart_rtl.init();
#endif
// run all the vehicle initialization routines
init_vehicle();
// initialise AP_Logger library
logger.setVehicle_Startup_Writer(FUNCTOR_BIND(&copter, &Copter::Log_Write_Vehicle_Startup_Messages, void));