20 #undef _MATH_DEFINES_DEFINED 21 #define _MATH_DEFINES_DEFINED 30 #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) 32 #define PLATFORM_IS_WINDOWS 1 33 #define PLATFORM_IS_EMBEDDED 0 34 #ifndef _CRT_SECURE_NO_DEPRECATE 35 #define _CRT_SECURE_NO_DEPRECATE 43 #define socket_t SOCKET 45 #define CPU_IS_LITTLE_ENDIAN (REG_DWORD == REG_DWORD_LITTLE_ENDIAN) 46 #define CPU_IS_BIG_ENDIAN (REG_DWORD == REG_DWORD_BIG_ENDIAN) 47 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 48 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 50 #elif defined(__APPLE__) 54 #define PLATFORM_IS_APPLE 1 55 #define PLATFORM_IS_EMBEDDED 0 57 #if defined(__LITTLE_ENDIAN__) 58 #define CPU_IS_LITTLE_ENDIAN 1 59 #define CPU_IS_BIG_ENDIAN 0 60 #elif defined(__BIG_ENDIAN__) 61 #define CPU_IS_LITTLE_ENDIAN 0 62 #define CPU_IS_BIG_ENDIAN 1 65 #elif defined(__linux__) || defined(__unix__) || defined(__CYGWIN__) 70 #error __BYTE_ORDER not defined, must be __LITTLE_ENDIAN or __BIG_ENDIAN 73 #define PLATFORM_IS_LINUX 1 74 #define PLATFORM_IS_EMBEDDED 0 76 #define CPU_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN) 77 #define CPU_IS_BIG_ENDIAN (__BYTE_ORDER == __BIG_ENDIAN) 79 #elif defined(__INERTIAL_SENSE_EVB_2__) 80 #define PLATFORM_IS_EMBEDDED 1 81 #define PLATFORM_IS_ARM 1 82 #define PLATFORM_IS_EVB_2 1 83 #define CPU_IS_LITTLE_ENDIAN 1 84 #define CPU_IS_BIG_ENDIAN 0 87 #elif defined(ARM) || defined(__SAM3X8E__) 89 #define PLATFORM_IS_EMBEDDED 1 90 #define PLATFORM_IS_ARM 1 91 #define CPU_IS_LITTLE_ENDIAN 1 92 #define CPU_IS_BIG_ENDIAN 0 94 #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega168__) ||defined(__AVR_ATmega168P__) ||defined(__AVR_ATmega328P__) 95 #define PLATFORM_IS_EMBEDDED 1 96 #define PLATFORM_IS_ARM 0 97 #define CPU_IS_LITTLE_ENDIAN 1 98 #define CPU_IS_BIG_ENDIAN 0 100 #elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) 102 #define PLATFORM_IS_EMBEDDED 1 103 #define PLATFORM_IS_ARM 1 104 #define CPU_IS_LITTLE_ENDIAN 1 105 #define CPU_IS_BIG_ENDIAN 0 109 #error Unknown platform not supported, be sure to set it up here, defining CPU_IS_LITTLE_ENDIAN and CPU_IS_BIG_ENDIAN 111 #endif // platform defines 113 #if !defined(CPU_IS_LITTLE_ENDIAN) || !defined(CPU_IS_BIG_ENDIAN) || CPU_IS_LITTLE_ENDIAN == CPU_IS_BIG_ENDIAN 115 #error Unsupported / unknown CPU architecture 117 #endif // Invalid CPU endianess 121 #if !defined(PLATFORM_IS_EMBEDDED) 122 #error "Missing PLATFORM_IS_EMBEDDED macro!!!" 126 #if PLATFORM_IS_EMBEDDED 130 #define MALLOC(m) pvPortMalloc(m) 131 #define REALLOC(m, size) 0 // not supported 132 #define FREE(m) vPortFree(m) 136 #define MALLOC(m) malloc(m) 137 #define REALLOC(m, size) realloc(m, size) 138 #define FREE(m) free(m) 142 #if PLATFORM_IS_EMBEDDED 143 #include "../hw-libs/printf-master/printf.h" 144 #define SNPRINTF snprintf_ 146 #define SNPRINTF snprintf 150 #if defined(_MSC_VER) 153 #define INLINE __inline 157 #define SSCANF(src, fmt, ...) sscanf_s(src, fmt, __VA_ARGS__); 161 #define STRNCPY(a, b, c) strncpy_s(a, c, b, c); 164 #define strncasecmp _strnicmp 169 #define INLINE inline 173 #define SSCANF sscanf 177 #define STRNCPY(a, b, c) strncpy((char*)a, (char*)b, c) 180 #endif // defined(_MSC_VER) 182 #if defined(PLATFORM_IS_EVB_2) 183 #define _MKDIR(dir) f_mkdir(dir) 184 #define _RMDIR(dir) f_unlink(dir) 185 #define _GETCWD(buf, len) f_getcwd(buf, len) 187 #elif !PLATFORM_IS_EMBEDDED 188 #define BEGIN_CRITICAL_SECTION 189 #define END_CRITICAL_SECTION 190 #define DBGPIO_ENABLE(pin) 191 #define DBGPIO_START(pin) 192 #define DBGPIO_END(pin) 193 #define DBGPIO_TOGGLE(pin) 195 #if PLATFORM_IS_WINDOWS 198 #include <sys/utime.h> 199 #define _MKDIR(dir) _mkdir(dir) 200 #define _RMDIR(dir) _rmdir(dir) 201 #define _GETCWD(buf, len) _getcwd(buf, len) 202 #define _UTIME _utime 203 #define _UTIMEBUF struct _utimbuf 211 #include <sys/stat.h> 213 #define _MKDIR(dir) mkdir(dir, ACCESSPERMS) // 0777 access for all 214 #define _RMDIR(dir) rmdir(dir) 215 #define _GETCWD(buf, len) getcwd(buf, len) 217 #define _UTIMEBUF struct utimbuf 224 #if defined(_MSC_VER) 225 #define PUSH_PACK_1 __pragma(pack(push, 1)) 226 #define PUSH_PACK_4 __pragma(pack(push, 4)) 227 #define PUSH_PACK_8 __pragma(pack(push, 8)) 228 #define POP_PACK __pragma(pack(pop)) 231 #define PUSH_PACK_1 _Pragma("pack(push, 1)") 232 #define PUSH_PACK_4 _Pragma("pack(push, 4)") 233 #define PUSH_PACK_8 _Pragma("pack(push, 8)") 234 #define POP_PACK _Pragma("pack(pop)") 244 #if defined ( __CC_ARM ) 245 # define RAMFUNC __attribute__ ((section(".ramfunc"))) 246 #elif defined ( __ICCARM__ ) 247 # define RAMFUNC __ramfunc 248 #elif defined ( __GNUC__ ) 249 # define RAMFUNC __attribute__ ((section(".ramfunc"))) 257 #define UNMASK(_word, _prefix) (((_word) & (_prefix##_MASK)) >> (_prefix##_SHIFT)) 261 #define MASK(_prefix, _val) ((_prefix##_MASK) & ((_val) << (_prefix##_SHIFT))) 265 #define SWAP16(v) ((uint16_t)(((uint16_t)(v) >> 8) | ((uint16_t)(v) << 8))) 269 #if defined(__GNUC__) 270 #define SWAP32 __builtin_bswap32 271 #define SWAP64 __builtin_bswap64 272 #elif defined(__ICCAVR32__) 273 #define SWAP32 __swap_bytes 274 #elif defined(_MSC_VER) 276 #define SWAP32 _byteswap_ulong 277 #define SWAP64 _byteswap_uint64 282 #define SWAP32(v) ((uint32_t)(((uint32_t)SWAP16((uint32_t)(v) >> 16)) | ((uint32_t)SWAP16((uint32_t)(v)) << 16))) 286 #define SWAP64(v) ((uint64_t)(((uint64_t)SWAP32((uint64_t)(v) >> 32)) | ((uint64_t)SWAP32((uint64_t)(v)) << 32))) 290 #define _ABS(a) (a < 0 ? -a : a) 294 #define _MAX(a,b) (((a) > (b)) ? (a) : (b)) 298 #define _MIN(a,b) (((a) < (b)) ? (a) : (b)) 302 #define _CLAMP(v, minV, maxV) (v < minV ? minV : (v > maxV ? maxV : v)) 306 #define _SATURATE(v) _CLAMP(v, 0, 1) 310 #define _LIMIT(x, lim) {if(!((x)>(-lim))){(x)=(-lim);}else{if(!((x)<(lim))){(x)=(lim);}}} // Works w/ NAN 314 #define _LIMIT2(x, xmin, xmax) { if ((x) < (xmin)) { (x) = (xmin); } else { if ((x) > (xmax)) { (x) = (xmax); } } } 318 #define _ISNAN(a) ((a)!=(a)) 321 #ifndef _ARRAY_BYTE_COUNT 322 #define _ARRAY_BYTE_COUNT(a) sizeof(a) 325 #ifndef _ARRAY_ELEMENT_COUNT 326 #define _ARRAY_ELEMENT_COUNT(a) (sizeof(a) / sizeof(a[0])) 329 #ifndef _MEMBER_ARRAY_ELEMENT_COUNT 330 #define _MEMBER_ARRAY_ELEMENT_COUNT(type, member) _ARRAY_ELEMENT_COUNT(((type*)0)->member) 334 #define MEMBERSIZE(type, member) sizeof(((type*)0)->member) 337 #ifndef MEMBER_ITEM_SIZE 338 #define MEMBER_ITEM_SIZE(type, member) sizeof(((type*)NULL)->member[0]) 342 #ifndef OFFSET_OF_MEMBER_INDEX 343 #define OFFSET_OF_MEMBER_INDEX(type, member, i) (offsetof(type, member) + (i) * MEMBER_ITEM_SIZE(type, member)) 347 #ifndef OFFSET_OF_MEMBER_INDEX_SUBMEMBER 348 #define OFFSET_OF_MEMBER_INDEX_SUBMEMBER(type, member, i, submember) (offsetof(type, member[0].submember) + (i) * MEMBER_ITEM_SIZE(type, member)) 352 #define STRINGIFY(x) #x 356 #define M_PI (3.14159265358979323846f) 360 #define RAD2DEG(rad) ((rad)*(180.0f/M_PI)) 363 #define DEG2RAD(deg) ((deg)*(M_PI/180.0f)) 366 #define DEG2RADMULT (M_PI/180.0f) 369 #define RAD2DEGMULT (180.0f/M_PI) 371 #define ATanH(x) (0.5 * log((1 + x) / (1 - x))) 373 #if defined(__cplusplus) 375 #define PURE_VIRTUAL = 0 379 #if ((defined(_MSC_VER) && _MSC_VER >= 1900) || (defined(__cplusplus) && ((__cplusplus >= 201103L || (__cplusplus < 200000 && __cplusplus > 199711L))))) 381 #ifndef CPP11_IS_ENABLED 382 #define CPP11_IS_ENABLED 1 384 #ifndef CONST_EXPRESSION 385 #define CONST_EXPRESSION constexpr static 387 #ifndef STATIC_ASSERT 388 #define STATIC_ASSERT(exp) static_assert(exp, "STATIC ASSERT FAILED!") 390 #ifndef STATIC_ASSERT_MSG 391 #define STATIC_ASSERT_MSG(exp, msg) static_assert(exp, msg) 394 #define OVERRIDE override 397 #define NULLPTR nullptr 407 #ifndef CPP11_IS_ENABLED 408 #define CPP11_IS_ENABLED 0 410 #ifndef CONST_EXPRESSION 411 #define CONST_EXPRESSION static const 413 #define PRE_PROC_COMBINE(X, Y) X##Y 414 #ifndef STATIC_ASSERT 416 #define STATIC_ASSERT(exp) static_assert(exp, "STATIC ASSERT FAILED!") 418 #ifndef STATIC_ASSERT_MSG 420 #define STATIC_ASSERT_MSG(exp, msg) static_assert(exp, msg) 439 #define UINT32_TIME_DIFF(current, prev) ((uint32_t)(current) - (uint32_t)(prev)) 441 #define DT_TO_HZ(dt) (((dt) == (0.0)) ? (0) : (1.0/dt)) 443 #define C_WEEKS_TO_SECONDS 604800.0 // Seconds per week 444 #define C_WEEKS_TO_MILLISECONDS 604800000 // Milliseconds per week 446 #define MS2SEC_D(ms) ((static_cast<double>(ms))*1.0E-3) // Convert milliseconds to seconds 451 #define C_IN2M 0.0254 // inches to meters 452 #define C_FT2M 0.3048 // (C_IN2M*12) feet to meters 453 #define C_M2FT 3.2808398950131233595800524934383 // (1.0/C_FT2M) 455 #define C_YD2M 0.9144 // (C_FT2M*3) yards to meters 457 #define C_IN2M_F 0.0254f // inches to meters 458 #define C_FT2M_F 0.3048f // (C_IN2M*12) feet to meters 459 #define C_M2FT_F 3.2808398950131233595800524934383f // (1.0/C_FT2M) 460 #define C_YD2M_F 0.9144f // (C_FT2M*3) yards to meters 463 #define C_NMI2M 1852.0 // nautical miles to meters 464 #define C_MI2M 1609.344 // (C_FT2M*5280) miles to meters 466 #define C_NMI2M_F 1852.0f // nautical miles to meters 467 #define C_MI2M_F 1609.344f // (C_FT2M*5280) miles to meters 469 #define C_METERS_KNOTS 1.943844 // Meters/sec squared to knots 470 #define C_METERS_KNOTS_F 1.943844f // Meters/sec squared to knots 472 #define C_KNOTS_METERS_F 0.514444444f // Knots to meters/sec 481 #define C_G_TO_MPS2 9.80665 // (m/s^2) standard gravity 482 #define C_MPS2_TO_G 0.101971621297793 483 #define C_G_TO_FTPS2 32.17404856 // (ft/s^2) standard gravity 485 #define C_G_TO_MPS2_F 9.80665f // (m/s^2) standard gravity 486 #define C_MPS2_TO_G_F 0.101971621297793f 487 #define C_G_TO_FTPS2_F 32.17404856f // (ft/s^2) standard gravity 495 #define C_P0N_M2 1.01325e5 // p0 in N/m^2 496 #define C_P0N_M2_F 1.01325e5f // p0 in N/m^2 497 #define C_P0 14.692125 // (C_P0N_M2*1.450e-4) 498 #define C_P0_F 14.692125f // (C_P0N_M2*1.450e-4) 500 #define C_P0_PA_F 101325f // (Pa) Sea level standard atmospheric pressure 501 #define C_P0_KPA_F 101.325f // (kPa) Sea level standard atmospheric pressure 502 #define C_P0_MBAR_F 1013.25f // (mbar) Sea level standard atmospheric pressure 504 #define C_INV_P0_KPA_F 9.8692326671601283e-3f // (1/kPa) Inverse of Sea level standard atmospheric pressure 506 #define C_MBAR_TO_KPA_F 0.1f // (kpa/mbar) absolute pressure 507 #define C_KPA_TO_MBAR_F 10.0f // (mbar/kpa) absolute pressure 508 #define C_MBAR_TO_PA_F 100.0f // (kpa/mbar) absolute pressure 513 #define C_T0_F 288.15f // (K) Sea level standard temperature 518 #define C_LBM2KG 0.45359237 // lb mass 519 #define C_KG2LBM 2.204622622 // (1.0/C_LBM2KG) 520 #define C_LBF2N 4.448221615 // (C_LBM2KG*C_G0MPERSEC2) lb force 521 #define C_SLUG2KG 14.59390294 // (C_LBM2KG*C_G0) slugs 523 #define C_LBM2KG_F 0.45359237f // lb mass 524 #define C_KG2LBM_F 2.204622622f // (1.0/C_LBM2KG) 525 #define C_LBF2N_F 4.448221615f // (C_LBM2KG*C_G0MPERSEC2) lb force 526 #define C_SLUG2KG_F 14.59390294f // (C_LBM2KG*C_G0) slugs 531 #define C_ROOT2 1.41421356237309504880168872420969807856967187537695 532 #define C_ROOT3 1.73205080756887729352744634150587236694280525381039 533 #define C_E 2.71828182845904523536028747135266249775724709369996 534 #define C_DIVROOT2 0.70710678118654752440084436210485 536 #define C_ROOT2_F 1.41421356237309504880168872420969807856967187537695f 537 #define C_ROOT3_F 1.73205080756887729352744634150587236694280525381039f 538 #define C_E_F 2.71828182845904523536028747135266249775724709369996f 539 #define C_DIVROOT_F 0.70710678118654752440084436210485f 541 #define C_PIDIV16 0.19634954084936207740391521145497 // 11.25 deg 542 #define C_PIDIV8 0.39269908169872415480783042290994 // 22.5 deg 543 #define C_PIDIV4 0.78539816339744830961566084581988 544 #define C_PIDIV2 1.5707963267948966192313216916398 545 #define C_PI 3.14159265358979323846264338327950288419716939937511 546 #define C_TWOPI 6.283185307179586476925286766559 547 #define C_DIVTWOPI 0.15915494309189533576888376337251 548 #define C_DIVPI 0.31830988618379067153776752674503 550 #define C_PIDIV16_F 0.19634954084936207740391521145497f // 11.25 deg 551 #define C_PIDIV8_F 0.39269908169872415480783042290994f // 22.5 deg 552 #define C_PIDIV4_F 0.78539816339744830961566084581988f // 45 deg 553 #define C_PIDIV2_F 1.5707963267948966192313216916398f // 90 deg 554 #define C_PI_F 3.14159265358979323846264338327950288419716939937511f // 180 deg 555 #define C_TWOPI_F 6.283185307179586476925286766559f // 360 deg 556 #define C_DIVTWOPI_F 0.15915494309189533576888376337251f 557 #define C_DIVPI_F 0.31830988618379067153776752674503f 559 #define C_DEG2RAD 0.017453292519943295769236907684886 560 #define C_DEG2RAD_F 0.017453292519943295769236907684886f 561 #define C_RAD2DEG 57.295779513082320876798154814105 562 #define C_RAD2DEG_F 57.295779513082320876798154814105f 565 #define C_MM2M_F 0.001f 566 #define C_M2MM 1000.0 567 #define C_M2MM_F 1000.0f 570 #define C_CM2M_F 0.01f 572 #define C_IN2M 0.0254 573 #define C_IN2M_F 0.0254f 574 #define C_M2IN 39.37007874 575 #define C_M2IN_F 39.37007874f 578 #define C_IN2MM_F 25.4f 579 #define C_MM2IN 0.03937007874 580 #define C_MM2IN_F 0.03937007874f 582 #define C_FPS2KT 0.5924838 583 #define C_FPS2KT_F 0.5924838f 584 #define C_KT2FPS 1.68780986 585 #define C_KT2FPS_F 1.68780986f 587 #define C_SQIN2SQFT 0.00694444444444444444444 588 #define C_SQIN2SQFT_F 0.00694444444444444444444f 589 #define C_SQFT2SQIN 144.0 590 #define C_SQFT2SQIN_F 144.0f 592 #define C_GPM2CFS 0.0022280093 593 #define C_GPM2CFS_F 0.0022280093f 594 #define C_CFS2GPM 448.83117 595 #define C_CFS2GPM_F 448.83117f 597 #define C_DEGF0_R 459.69 598 #define C_DEGC0_T 273.16 599 #define C_DEGC0_DEGF 32.0 600 #define C_DEGF_PER_DEGC 1.8 602 #define C_LN_2 0.69314718055994530941723212145818 603 #define C_LN_2_F 0.69314718055994530941723212145818f 606 #define C_C2K_F 273.16f 608 #define C_F2R_F 459.69f 610 #define C_G_CONST 1.068944098e-09 // 6.6732e-11*CUBE(C_M2FT)/C_KG2LBM 611 #define C_EARTH_MASS 1.317041554e25 // 5.974e24*C_KG2LBM 612 #define C_N0_AVOGADRO 6.02205e23 613 #define C_R_IDEAL_SU 8.31434 614 #define C_K_BOLTZMANN 1.380622e-23 615 #define C_C_LIGHT 983571194.2 // 2.9979250e+8*C_M2FT 616 #define C_ECHARGE 1.6021917e-19 618 #define C_DOFA 0.080719353 // 1.293*C_KG2LBM/CUBE(C_M2FT) 619 #define C_DOFH2O 62.427960576 // 1.000e3*C_KG2LBM/CUBE(C_M2FT) 620 #define C_STOFH2O 75.6 621 #define C_VOFH2O 1.787e-3 622 #define C_SOUND0VEL 1087.598425 // 331.5*C_M2FT 623 #define C_SOUND20VEL 1126.64042 // 343.4*C_M2FT 625 #define C_G_CONST_F 1.068944098e-09f // 6.6732e-11*CUBE(C_M2FT)/C_KG2LBM 626 #define C_EARTH_MASS_F 1.317041554e25f // 5.974e24*C_KG2LBM 627 #define C_N0_AVOGADRO_F 6.02205e23f 628 #define C_R_IDEAL_SU_F 8.31434f 629 #define C_K_BOLTZMANN_F 1.380622e-23f 630 #define C_C_LIGHT_F 983571194.2f // 2.9979250e+8*C_M2FT 631 #define C_ECHARGE_F 1.6021917e-19f 633 #define C_DOFA_F 0.080719353f // 1.293*C_KG2LBM/CUBE(C_M2FT) 634 #define C_DOFH2O_F 62.427960576f // 1.000e3*C_KG2LBM/CUBE(C_M2FT) 635 #define C_STOFH2O_F 75.6f 636 #define C_VOFH2O_F 1.787e-3f 637 #define C_SOUND0VEL_F 1087.598425f // 331.5*C_M2FT 638 #define C_SOUND20VEL_F 1126.64042f // 343.4*C_M2FT 640 #define C_WGS84_a 6378137.0 // WGS-84 semimajor axis (m) 641 #define C_WGS84_a_F 6378137.0f 642 #define C_WGS84_b 6356752.3142 // WGS-84 semiminor axis (m) 643 #define C_WGS84_b_F 6356752.3142f 644 #define C_WIE 7.2321151467e-05 // WGS-84 earth rotation rate (rad/s) 645 #define C_WIE_F 7.2321151467e-05f 647 #define C_TESLA2GAUSS_F 10000.0 648 #define C_UTESLA2GAUSS_F 0.01 650 #define C_0p1_DEG2RAD_F 0.00174532925199433f // = 0.1f * C_0pDEG2RAD_F 651 #define C_0p11_DEG2RAD_F 0.00191986217719376f 652 #define C_0p12_DEG2RAD_F 0.00209439510239320f 653 #define C_0p13_DEG2RAD_F 0.00226892802759263f 654 #define C_0p14_DEG2RAD_F 0.00244346095279206f 655 #define C_0p15_DEG2RAD_F 0.00261799387799149f 656 #define C_0p16_DEG2RAD_F 0.00279252680319093f 657 #define C_0p17_DEG2RAD_F 0.00296705972839036f 658 #define C_0p18_DEG2RAD_F 0.00314159265358979f 659 #define C_0p19_DEG2RAD_F 0.00331612557878923f 660 #define C_0p2_DEG2RAD_F 0.00349065850398866f 661 #define C_0p21_DEG2RAD_F 0.00366519142918809f 662 #define C_0p22_DEG2RAD_F 0.00383972435438753f 663 #define C_0p23_DEG2RAD_F 0.00401425727958696f 664 #define C_0p24_DEG2RAD_F 0.00418879020478639f 665 #define C_0p25_DEG2RAD_F 0.00436332312998582f 666 #define C_0p26_DEG2RAD_F 0.00453785605518526f 667 #define C_0p27_DEG2RAD_F 0.00471238898038469f 668 #define C_0p28_DEG2RAD_F 0.00488692190558412f 669 #define C_0p29_DEG2RAD_F 0.00506145483078356f 670 #define C_0p3_DEG2RAD_F 0.00523598775598299f 671 #define C_0p31_DEG2RAD_F 0.00541052068118242f 672 #define C_0p32_DEG2RAD_F 0.00558505360638185f 673 #define C_0p33_DEG2RAD_F 0.00575958653158129f 674 #define C_0p34_DEG2RAD_F 0.00593411945678072f 675 #define C_0p35_DEG2RAD_F 0.00610865238198015f 676 #define C_0p36_DEG2RAD_F 0.00628318530717959f 677 #define C_0p37_DEG2RAD_F 0.00645771823237902f 678 #define C_0p38_DEG2RAD_F 0.00663225115757845f 679 #define C_0p39_DEG2RAD_F 0.00680678408277788f 680 #define C_0p4_DEG2RAD_F 0.00698131700797732f 681 #define C_0p41_DEG2RAD_F 0.00715584993317675f 682 #define C_0p42_DEG2RAD_F 0.00733038285837618f 683 #define C_0p43_DEG2RAD_F 0.00750491578357562f 684 #define C_0p44_DEG2RAD_F 0.00767944870877505f 685 #define C_0p45_DEG2RAD_F 0.00785398163397448f 686 #define C_0p46_DEG2RAD_F 0.00802851455917391f 687 #define C_0p47_DEG2RAD_F 0.00820304748437335f 688 #define C_0p48_DEG2RAD_F 0.00837758040957278f 689 #define C_0p49_DEG2RAD_F 0.00855211333477222f 690 #define C_0p5_DEG2RAD_F 0.00872664625997165f // = 5.0f * C_0pDEG2RAD_F 691 #define C_0p6_DEG2RAD_F 0.01047197551196600f 692 #define C_0p7_DEG2RAD_F 0.01221730476396030f 693 #define C_0p8_DEG2RAD_F 0.01396263401595460f 694 #define C_0p9_DEG2RAD_F 0.01570796326794900f 695 #define C_1p0_DEG2RAD_F 0.0174532925199433f // = 1.0f * C_DEG2RAD_F 696 #define C_1p1_DEG2RAD_F 0.0191986217719376f 697 #define C_1p2_DEG2RAD_F 0.0209439510239320f 698 #define C_1p3_DEG2RAD_F 0.0226892802759263f 699 #define C_1p4_DEG2RAD_F 0.0244346095279206f 700 #define C_1p5_DEG2RAD_F 0.0261799387799149f 701 #define C_1p6_DEG2RAD_F 0.0279252680319093f 702 #define C_1p7_DEG2RAD_F 0.0296705972839036f 703 #define C_1p8_DEG2RAD_F 0.0314159265358979f 704 #define C_1p9_DEG2RAD_F 0.0331612557878923f 705 #define C_2p0_DEG2RAD_F 0.0349065850398866f 706 #define C_2p1_DEG2RAD_F 0.0366519142918809f 707 #define C_2p2_DEG2RAD_F 0.0383972435438753f 708 #define C_2p3_DEG2RAD_F 0.0401425727958696f 709 #define C_2p4_DEG2RAD_F 0.0418879020478639f 710 #define C_2p5_DEG2RAD_F 0.0436332312998582f 711 #define C_2p6_DEG2RAD_F 0.0453785605518526f 712 #define C_2p7_DEG2RAD_F 0.0471238898038469f 713 #define C_2p8_DEG2RAD_F 0.0488692190558412f 714 #define C_2p9_DEG2RAD_F 0.0506145483078356f 715 #define C_3p0_DEG2RAD_F 0.0523598775598299f 716 #define C_3p1_DEG2RAD_F 0.0541052068118242f 717 #define C_3p2_DEG2RAD_F 0.0558505360638185f 718 #define C_3p3_DEG2RAD_F 0.0575958653158129f 719 #define C_3p4_DEG2RAD_F 0.0593411945678072f 720 #define C_3p5_DEG2RAD_F 0.0610865238198015f 721 #define C_3p6_DEG2RAD_F 0.0628318530717959f 722 #define C_3p7_DEG2RAD_F 0.0645771823237902f 723 #define C_3p8_DEG2RAD_F 0.0663225115757845f 724 #define C_3p9_DEG2RAD_F 0.0680678408277788f 725 #define C_4p0_DEG2RAD_F 0.0698131700797732f 726 #define C_4p1_DEG2RAD_F 0.0715584993317675f 727 #define C_4p2_DEG2RAD_F 0.0733038285837618f 728 #define C_4p3_DEG2RAD_F 0.0750491578357562f 729 #define C_4p4_DEG2RAD_F 0.0767944870877505f 730 #define C_4p5_DEG2RAD_F 0.0785398163397448f 731 #define C_4p6_DEG2RAD_F 0.0802851455917391f 732 #define C_4p7_DEG2RAD_F 0.0820304748437335f 733 #define C_4p8_DEG2RAD_F 0.0837758040957278f 734 #define C_4p9_DEG2RAD_F 0.0855211333477222f 735 #define C_5p0_DEG2RAD_F 0.0872664625997165f // = 5.0f * C_DEG2RAD_F 736 #define C_6p0_DEG2RAD_F 0.1047197551196600f 737 #define C_7p0_DEG2RAD_F 0.1221730476396030f 738 #define C_8p0_DEG2RAD_F 0.1396263401595460f 739 #define C_9p0_DEG2RAD_F 0.1570796326794900f 740 #define C_10p0_DEG2RAD_F 0.1745329251994330f 741 #define C_15p0_DEG2RAD_F 0.2617993877991490f 742 #define C_20p0_DEG2RAD_F 0.3490658503988660f // = 20.0f * C_DEG2RAD_F 743 #define C_25p0_DEG2RAD_F 0.4363323129985820f 744 #define C_30p0_DEG2RAD_F 0.5235987755982990f 745 #define C_35p0_DEG2RAD_F 0.6108652381980150f 746 #define C_40p0_DEG2RAD_F 0.6981317007977320f 747 #define C_45p0_DEG2RAD_F 0.7853981633974480f 748 #define C_50p0_DEG2RAD_F 0.8726646259971650f 749 #define C_55p0_DEG2RAD_F 0.9599310885968810f 750 #define C_60p0_DEG2RAD_F 1.0471975511966000f 751 #define C_65p0_DEG2RAD_F 1.1344640137963100f 752 #define C_70p0_DEG2RAD_F 1.2217304763960300f 753 #define C_75p0_DEG2RAD_F 1.3089969389957500f 754 #define C_80p0_DEG2RAD_F 1.3962634015954600f 755 #define C_85p0_DEG2RAD_F 1.4835298641951800f 756 #define C_90p0_DEG2RAD_F 1.5707963267949000f 757 #define C_135p0_DEG2RAD_F 2.3561944901923400f 758 #define C_180p0_DEG2RAD_F 3.1415926535897900f 761 #define UNWRAP_DEG_F64(x) { if((x) < (-180.0 )) { (x) += (360.0 ); } if((x) > (180.0 )) { (x) -= (360.0 ); } } // unwrap to +- 180 762 #define UNWRAP_DEG_F32(x) { if((x) < (-180.0f)) { (x) += (360.0f); } if((x) > (180.0f)) { (x) -= (360.0f); } } // unwrap to +- 180 763 #define UNWRAP_90DEG_F64(x) { if((x) < (-90.0 )) { (x) += (180.0 ); } if((x) > (90.0 )) { (x) -= (180.0 ); } } // unwrap to +- 90 764 #define UNWRAP_90DEG_F32(x) { if((x) < (-90.0f)) { (x) += (180.0f); } if((x) > (90.0f)) { (x) -= (180.0f); } } // unwrap to +- 90 765 #define UNWRAP_F64(x) { if((x) < (-C_PI)) { (x) += (C_TWOPI); } if((x) > (C_PI)) { (x) -= (C_TWOPI); } } // unwrap to +- PI 766 #define UNWRAP_F32(x) { if((x) < (-C_PI_F)) { (x) += (C_TWOPI_F); } if((x) > (C_PI_F)) { (x) -= (C_TWOPI_F); } } // unwrap to +- PI 767 #define UNWRAP_ZERO_TWOPI_F64(x) { if((x) < (0.0)) { (x) += (C_TWOPI); } if((x) > (C_TWOPI)) { (x) -= (C_TWOPI); } } // unwrap to 0 to TWOPI 768 #define UNWRAP_ZERO_TWOPI_F32(x) { if((x) < (0.f)) { (x) += (C_TWOPI_F); } if((x) > (C_TWOPI_F)) { (x) -= (C_TWOPI_F); } } // unwrap to 0 to TWOPI 775 #define _ATAN2 atan2f 780 #define _DEG2RAD C_DEG2RAD_F 781 #define _RAD2DEG C_RAD2DEG_F 784 #define FLOAT2DOUBLE (double) // Used to prevent warning when compiling with -Wdouble-promotion in Linux 808 #endif // CONSTANTS_H_ void vPortFree(void *pv) PRIVILEGED_FUNCTION
void * pvPortMalloc(size_t xSize) PRIVILEGED_FUNCTION