STM32 移植Mavlink,Keil报一大堆错误
static void PosVelxEsti(const float dt, const float acc, const float vel, const float pos,
..\DATA\src\pos_esti.c(361): warning: #177-D: function "PosVelyEsti" was declared but never referenced
static void PosVelyEsti(const float dt, const float acc, const float vel, const float pos,
..\DATA\src\pos_esti.c(186): warning: #177-D: function "PosxEsti" was declared but never referenced
static void PosxEsti(const float dt, const float acc, const float vel, const float pos,
..\DATA\src\pos_esti.c(229): warning: #177-D: function "PosyEsti" was declared but never referenced
static void PosyEsti(const float dt, const float acc, const float vel, const float pos,
..\DATA\src\pos_esti.c(277): warning: #177-D: function "PoszEsti" was declared but never referenced
static void PoszEsti(const float dt, const float acc, const float pos,
..\DATA\src\pos_esti.c(543): warning: #177-D: function "AcceMean10" was declared but never referenced
static void AcceMean10(const struct XYZ_t *acc, struct XYZ_t *acc_mean)
..\DATA\src\pos_esti.c(826): warning: #177-D: function "PosVelzEsti" was declared but never referenced
static void PosVelzEsti(const float dt, const float acc, const float pos,
解决办法:
- 在
mavlink_types.h
中加入#pragma anon_unions
一句。 - 不要在自己的头文件中调用
mavlink_msg_xxx.h
等。