From 6a0250bc8567b0e8bba8794a084f4e94b559c81b Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 4 Mar 2022 14:55:36 +1100 Subject: [PATCH] AP_Winch: stop libraries including AP_Logger.h in .h files AP_Logger.h is a nexus of includes; while this is being improved over time, there's no reason for the library headers to include AP_Logger.h as the logger itself is access by singleton and the structures are in LogStructure.h This necessitated moving The PID_Info structure out of AP_Logger's namespace. This cleans up a pretty nasty bit - that structure is definitely not simply used for logging, but also used to pass pid information around to controllers! There are a lot of patches in here because AP_Logger.h, acting as a nexus, was providing transitive header file inclusion in many (some unlikely!) places. --- libraries/AP_Winch/AP_Winch.h | 2 +- libraries/AP_Winch/AP_Winch_Backend.cpp | 2 ++ libraries/AP_Winch/AP_Winch_Daiwa.cpp | 2 ++ libraries/AP_Winch/AP_Winch_PWM.cpp | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Winch/AP_Winch.h b/libraries/AP_Winch/AP_Winch.h index 0e03f7d0a7..81cbca5f73 100644 --- a/libraries/AP_Winch/AP_Winch.h +++ b/libraries/AP_Winch/AP_Winch.h @@ -59,7 +59,7 @@ public: float get_rate_max() const { return MAX(config.rate_max, 0.0f); } // send status to ground station - void send_status(const GCS_MAVLINK &channel); + void send_status(const class GCS_MAVLINK &channel); // write log void write_log(); diff --git a/libraries/AP_Winch/AP_Winch_Backend.cpp b/libraries/AP_Winch/AP_Winch_Backend.cpp index 9a01999ff4..61e395de01 100644 --- a/libraries/AP_Winch/AP_Winch_Backend.cpp +++ b/libraries/AP_Winch/AP_Winch_Backend.cpp @@ -1,5 +1,7 @@ #include + #include +#include // setup rc input and output void AP_Winch_Backend::init() diff --git a/libraries/AP_Winch/AP_Winch_Daiwa.cpp b/libraries/AP_Winch/AP_Winch_Daiwa.cpp index a213b38907..99f1921578 100644 --- a/libraries/AP_Winch/AP_Winch_Daiwa.cpp +++ b/libraries/AP_Winch/AP_Winch_Daiwa.cpp @@ -1,4 +1,6 @@ #include + +#include #include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Winch/AP_Winch_PWM.cpp b/libraries/AP_Winch/AP_Winch_PWM.cpp index 7a26f931de..afd7d77009 100644 --- a/libraries/AP_Winch/AP_Winch_PWM.cpp +++ b/libraries/AP_Winch/AP_Winch_PWM.cpp @@ -1,4 +1,6 @@ #include "AP_Winch_PWM.h" + +#include #include extern const AP_HAL::HAL& hal;