From 886cc9aa4670c4e31ef4100fe3550e411e7dd705 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 19 Jan 2015 22:38:17 +0900 Subject: [PATCH] Mount: use SerialManager for init --- libraries/AP_Mount/AP_Mount.cpp | 4 ++-- libraries/AP_Mount/AP_Mount.h | 3 ++- libraries/AP_Mount/AP_Mount_Backend.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index 4f3985823e..0688ffcfc8 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -401,7 +401,7 @@ AP_Mount::AP_Mount(const AP_AHRS &ahrs, const struct Location ¤t_loc) : } // init - detect and initialise all mounts -void AP_Mount::init() +void AP_Mount::init(const AP_SerialManager& serial_manager) { // check init has not been called before if (_num_instances != 0) { @@ -433,7 +433,7 @@ void AP_Mount::init() // init new instance if (_backends[instance] != NULL) { - _backends[instance]->init(); + _backends[instance]->init(serial_manager); if (!primary_set) { _primary = instance; primary_set = true; diff --git a/libraries/AP_Mount/AP_Mount.h b/libraries/AP_Mount/AP_Mount.h index 38428a6ee3..5f8135867a 100644 --- a/libraries/AP_Mount/AP_Mount.h +++ b/libraries/AP_Mount/AP_Mount.h @@ -28,6 +28,7 @@ #include #include #include +#include // maximum number of mounts #define AP_MOUNT_MAX_INSTANCES 1 @@ -60,7 +61,7 @@ public: AP_Mount(const AP_AHRS &ahrs, const struct Location ¤t_loc); // init - detect and initialise all mounts - void init(); + void init(const AP_SerialManager& serial_manager); // update - give mount opportunity to update servos. should be called at 10hz or higher void update(); diff --git a/libraries/AP_Mount/AP_Mount_Backend.h b/libraries/AP_Mount/AP_Mount_Backend.h index 9d544c58b5..8c587b52e8 100644 --- a/libraries/AP_Mount/AP_Mount_Backend.h +++ b/libraries/AP_Mount/AP_Mount_Backend.h @@ -39,7 +39,7 @@ public: virtual ~AP_Mount_Backend(void) {} // init - performs any required initialisation for this instance - virtual void init() = 0; + virtual void init(const AP_SerialManager& serial_manager) = 0; // update mount position - should be called periodically virtual void update() = 0;