From b3d8c0fc0834eb8673bbcc182b771d9b7dcbff1d Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 23 Aug 2017 17:58:31 -0700 Subject: [PATCH] AP_Mount: use DataFlash_Class::instance() Instead of requiring DataFlash_Class reference to be passed on the init() function, get it from the singleton directly. --- libraries/AP_Mount/AP_Mount.cpp | 4 ++-- libraries/AP_Mount/AP_Mount.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index 0dfca17b9f..cbeafbbad6 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -408,14 +408,14 @@ AP_Mount::AP_Mount(const AP_AHRS_TYPE &ahrs, const struct Location ¤t_loc) } // init - detect and initialise all mounts -void AP_Mount::init(DataFlash_Class *dataflash, const AP_SerialManager& serial_manager) +void AP_Mount::init(const AP_SerialManager& serial_manager) { // check init has not been called before if (_num_instances != 0) { return; } - _dataflash = dataflash; + _dataflash = DataFlash_Class::instance(); // default mount to servo mount if rc output channels to control roll, tilt or pan have been defined if (!state[0]._type.configured()) { diff --git a/libraries/AP_Mount/AP_Mount.h b/libraries/AP_Mount/AP_Mount.h index 0a24bb403a..aea492b61e 100644 --- a/libraries/AP_Mount/AP_Mount.h +++ b/libraries/AP_Mount/AP_Mount.h @@ -70,7 +70,7 @@ public: AP_Mount(const AP_AHRS_TYPE &ahrs, const struct Location ¤t_loc); // init - detect and initialise all mounts - void init(DataFlash_Class *dataflash, const AP_SerialManager& serial_manager); + void init(const AP_SerialManager& serial_manager); // update - give mount opportunity to update servos. should be called at 10hz or higher void update();