Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version number to 2.3.5 #36

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit AHRS
version=2.3.3
version=2.3.5
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=AHRS (Altitude and Heading Reference System) for various Adafruit motion sensors
Expand Down
15 changes: 8 additions & 7 deletions src/Adafruit_AHRS_Madgwick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ void Adafruit_Madgwick::updateIMU(float gx, float gy, float gz, float ax,

float Adafruit_Madgwick::invSqrt(float x) {
float halfx = 0.5f * x;
float y = x;
long i = *(long *)&y;
i = 0x5f3759df - (i >> 1);
y = *(float *)&i;
y = y * (1.5f - (halfx * y * y));
y = y * (1.5f - (halfx * y * y));
return y;
union {
float f;
long i;
} conv = {x};
conv.i = 0x5f3759df - (conv.i >> 1);
conv.f *= 1.5f - (halfx * conv.f * conv.f);
conv.f *= 1.5f - (halfx * conv.f * conv.f);
return conv.f;
}

//-------------------------------------------------------------------------------------------
Expand Down
15 changes: 8 additions & 7 deletions src/Adafruit_AHRS_Mahony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,14 @@ void Adafruit_Mahony::updateIMU(float gx, float gy, float gz, float ax,

float Adafruit_Mahony::invSqrt(float x) {
float halfx = 0.5f * x;
float y = x;
long i = *(long *)&y;
i = 0x5f3759df - (i >> 1);
y = *(float *)&i;
y = y * (1.5f - (halfx * y * y));
y = y * (1.5f - (halfx * y * y));
return y;
union {
float f;
long i;
} conv = {x};
conv.i = 0x5f3759df - (conv.i >> 1);
conv.f *= 1.5f - (halfx * conv.f * conv.f);
conv.f *= 1.5f - (halfx * conv.f * conv.f);
return conv.f;
}

//-------------------------------------------------------------------------------------------
Expand Down