From 181b3d00e69bf47ef955e53602817dac94dbf44b Mon Sep 17 00:00:00 2001 From: Anne Brondijk <73667900+abrondijk@users.noreply.github.com> Date: Sun, 16 Jun 2024 17:06:58 +0200 Subject: [PATCH] fix: Marked some functions as inline (#259) --- components/bldc_haptics/include/detent_config.hpp | 2 +- components/bldc_motor/include/foc_utils.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bldc_haptics/include/detent_config.hpp b/components/bldc_haptics/include/detent_config.hpp index 3f1cf6a6a..c25c70ea8 100644 --- a/components/bldc_haptics/include/detent_config.hpp +++ b/components/bldc_haptics/include/detent_config.hpp @@ -31,7 +31,7 @@ struct DetentConfig { /// @param lhs Left hand side of the equality /// @param rhs Right hand side of the equality /// @return True if the two DetentConfigs are equal -bool operator==(const DetentConfig &lhs, const DetentConfig &rhs) { +inline bool operator==(const DetentConfig &lhs, const DetentConfig &rhs) { bool vectors_equal = lhs.detent_positions.size() == rhs.detent_positions.size() && std::equal(lhs.detent_positions.begin(), lhs.detent_positions.end(), rhs.detent_positions.begin()); diff --git a/components/bldc_motor/include/foc_utils.hpp b/components/bldc_motor/include/foc_utils.hpp index 103726a1b..38a34d030 100644 --- a/components/bldc_motor/include/foc_utils.hpp +++ b/components/bldc_motor/include/foc_utils.hpp @@ -43,10 +43,10 @@ struct PhaseCurrent { float c; }; -float normalize_angle(float angle) { +inline float normalize_angle(float angle) { float a = fmod(angle, _2PI); return a >= 0 ? a : (a + _2PI); } -float calc_electrical_angle(float shaft_angle, int pole_pairs) { return shaft_angle * pole_pairs; } +inline float calc_electrical_angle(float shaft_angle, int pole_pairs) { return shaft_angle * pole_pairs; } } // namespace espp