mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
libdsp: Fix compile error with the standard math library
The libdsp uses M_PI_F and M_PI_2_F which are defined only in the NuttX math library. Fix an compile error when CONFIG_LIBM is disabled and the other math library is used.
This commit is contained in:
committed by
Mateusz Szafoni
parent
b65c7c26cf
commit
917f1a64ad
@@ -70,6 +70,16 @@
|
||||
|
||||
/* Some lib constants *******************************************************/
|
||||
|
||||
/* These are defined only in the NuttX math library */
|
||||
|
||||
#ifndef M_PI_F
|
||||
#define M_PI_F ((float)M_PI)
|
||||
#endif
|
||||
|
||||
#ifndef M_PI_2_F
|
||||
#define M_PI_2_F ((float)M_PI_2)
|
||||
#endif
|
||||
|
||||
/* Motor electrical angle is in range 0.0 to 2*PI */
|
||||
|
||||
#define MOTOR_ANGLE_E_MAX (2.0f*M_PI_F)
|
||||
|
||||
Reference in New Issue
Block a user