os_types.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _OS_Type_H__
  2. #define _OS_Type_H__
  3. #include <string.h>
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6. #include <stdint.h>
  7. #include <stdbool.h>
  8. #include <math.h>
  9. #ifndef TRUE
  10. #define TRUE 1
  11. #endif
  12. #ifndef FALSE
  13. #define FALSE 0
  14. #endif
  15. typedef uint8_t u8;
  16. typedef uint16_t u16;
  17. typedef uint32_t u24;
  18. typedef uint32_t u32;
  19. typedef uint64_t u64;
  20. typedef int8_t s8;
  21. typedef int16_t s16;
  22. typedef int32_t s24;
  23. typedef int32_t s32;
  24. typedef int64_t s64;
  25. typedef signed char int8;
  26. typedef signed short int16;
  27. typedef signed int int32;
  28. typedef unsigned char uint8;
  29. typedef unsigned short uint16;
  30. typedef unsigned int uint32;
  31. #define NEGATIVE ((int8_t)-1)
  32. #define POSITIVE ((int8_t)1)
  33. #define PHASE_0_DEGREE (0.0f)
  34. #define PHASE_60_DEGREE (60.0f)
  35. #define PHASE_120_DEGREE (120.0f)
  36. #define PHASE_180_DEGREE (180.0f)
  37. #define PHASE_240_DEGREE (240.0f)
  38. #define PHASE_300_DEGREE (300.0f)
  39. #define PHASE_360_DEGREE (360.0f)
  40. #define rand_angle(a) {while (a >= PHASE_360_DEGREE) a-=PHASE_360_DEGREE;while (a < 0) a +=PHASE_360_DEGREE;};
  41. #define ABS(x) ( (x)>0?(x):-(x) )
  42. extern void *pvPortMalloc( size_t xWantedSize );
  43. #define os_alloc pvPortMalloc
  44. extern void vPortFree(void *);
  45. #define os_free vPortFree
  46. #endif /* _OS_Type_H__ */