common.h 429 B

1234567891011121314151617181920
  1. #ifndef __COMMON_H
  2. #define __COMMON_H
  3. /// 支持的最多 航点数
  4. #define MAX_WP_NUM 1500
  5. typedef enum
  6. {
  7. COMP_NOEXIST = 0,
  8. COMP_NORMAL = 1,
  9. COMP_LOST = 2,
  10. COMP_CLOSED = 3
  11. } comp_status;
  12. /// 通过结构体成员寻找结构体对象本身的地址
  13. #define GET_CONTAINER_OF(ptr, type, member) \
  14. ((type *)((char *)(ptr) - (unsigned long)(&((type *)0)->member)))
  15. #endif