From 7498972b8d5e35e1bf664685b743d84bc29b44e3 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 15 Mar 2019 22:15:44 +1100 Subject: [PATCH] AP_RPM: add AP::rpm() call for singleton --- libraries/AP_RPM/AP_RPM.cpp | 8 ++++++++ libraries/AP_RPM/AP_RPM.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/libraries/AP_RPM/AP_RPM.cpp b/libraries/AP_RPM/AP_RPM.cpp index 1ead3077cb..0aa96520b6 100644 --- a/libraries/AP_RPM/AP_RPM.cpp +++ b/libraries/AP_RPM/AP_RPM.cpp @@ -182,3 +182,11 @@ bool AP_RPM::enabled(uint8_t instance) const // singleton instance AP_RPM *AP_RPM::_singleton; +namespace AP { + +AP_RPM *rpm() +{ + return AP_RPM::get_singleton(); +} + +} diff --git a/libraries/AP_RPM/AP_RPM.h b/libraries/AP_RPM/AP_RPM.h index a473e63913..87e6693f9d 100644 --- a/libraries/AP_RPM/AP_RPM.h +++ b/libraries/AP_RPM/AP_RPM.h @@ -104,3 +104,7 @@ private: void detect_instance(uint8_t instance); void update_instance(uint8_t instance); }; + +namespace AP { + AP_RPM *rpm(); +};