From 7f5dc33e7e610cd2d73d3c132d5021883c6ee475 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Tue, 8 Mar 2022 21:46:48 +0530 Subject: [PATCH] AP_Periph: allow can_printf as periph member method as well --- Tools/AP_Periph/AP_Periph.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index d1a30466cb..50b5e25f7e 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -53,6 +53,10 @@ void stm32_watchdog_pat(); */ extern const struct app_descriptor app_descriptor; +extern "C" { +void can_printf(const char *fmt, ...) FMT_PRINTF(1,2); +} + class AP_Periph_FW { public: AP_Periph_FW(); @@ -257,6 +261,7 @@ public: void show_stack_free(); static bool no_iface_finished_dna; + static constexpr auto can_printf = ::can_printf; }; namespace AP @@ -266,7 +271,4 @@ namespace AP extern AP_Periph_FW periph; -extern "C" { -void can_printf(const char *fmt, ...) FMT_PRINTF(1,2); -}