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

libraries: unify the pi values #17536

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/AP_GyroFFT/CMSIS_5/include/arm_math.h
Expand Up @@ -346,7 +346,7 @@ extern "C"
#define DELTA_Q15 0x5
#define INDEX_MASK 0x0000003F
#ifndef PI
#define PI 3.14159265358979f
#define PI (M_PI)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really be modifying CMSIS_5 source code? @andyp1per

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes let's not modify it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andyp1per - we really ought not leave these little landmines around for other people to find, but I can't see how we can sensibly put warnings on these things for people to find.

#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_SITL/Synth.hpp
Expand Up @@ -33,7 +33,7 @@ struct sTone
////////////////////////////////////////////////////////////
// Converts frequency (Hz) to angular velocity
////////////////////////////////////////////////////////////
const double PI = 3.14159265359;
const double PI = M_PI;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is someone else's code we're borrowing here, too. Not sure we want to be modifying it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we should put a float PI into a double PI

double w(const double dHertz)
{
return dHertz * 2.0 * PI;
Expand Down