STM32 移植Mavlink,Keil报错

在将Mavlink协议移植到STM32项目中时,遇到了Keil编译器报告关于未引用函数的警告。这些问题涉及到PosEsti和AcceMean10等函数。解决方法是在mavlink_types.h中添加#pragmaanon_unions指令,避免在自己的头文件中直接引用mavlink的消息定义头文件。
摘要由CSDN通过智能技术生成

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, 

解决办法:

  1. mavlink_types.h 中加入 #pragma anon_unions 一句。
  2. 不要在自己的头文件中调用 mavlink_msg_xxx.h 等。

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大强强小强强

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值