Skip to content

Commit

Permalink
fix: Marked some functions as inline (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrondijk authored Jun 16, 2024
1 parent e23b225 commit 181b3d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/bldc_haptics/include/detent_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions components/bldc_motor/include/foc_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 181b3d0

Please sign in to comment.