mixer: minor refactoring to reduce header include dependencies

- avoid including <px4_defines.h> from the math headers
- avoid driver include <drivers/drv_mixer.h> from the mixer
This commit is contained in:
Beat Küng
2018-12-13 09:50:07 +01:00
parent 8bcf54688a
commit c659d2bcc2
20 changed files with 60 additions and 45 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
#pragma once
#include <platforms/px4_defines.h>
#include "Limits.hpp"
namespace math
{
+8 -3
View File
@@ -39,8 +39,13 @@
#pragma once
#include <platforms/px4_defines.h>
#include <float.h>
#include <math.h>
#include <stdint.h>
#ifndef MATH_PI
#define MATH_PI 3.141592653589793238462643383280
#endif
//this should be defined in stdint.h, but seems to be missing in the ARM toolchain (5.2.0)
#ifndef UINT64_C
@@ -90,13 +95,13 @@ inline constexpr bool isInRange(const _Tp &val, const _Tp &min_val, const _Tp &m
template<typename T>
constexpr T radians(const T degrees)
{
return degrees * (static_cast<T>(M_PI) / static_cast<T>(180));
return degrees * (static_cast<T>(MATH_PI) / static_cast<T>(180));
}
template<typename T>
constexpr T degrees(const T radians)
{
return radians * (static_cast<T>(180) / static_cast<T>(M_PI));
return radians * (static_cast<T>(180) / static_cast<T>(MATH_PI));
}
/** Save way to check if float is zero */
-2
View File
@@ -40,8 +40,6 @@
#pragma once
#include <platforms/px4_defines.h>
namespace math
{
static constexpr double GOLDEN_RATIO = 1.6180339887; //(sqrt(5)+1)/2