# justfloat_report **Repository Path**: XMUT-PFA/justfloat_report ## Basic Information - **Project Name**: justfloat_report - **Description**: 基于可变参数实现的VOFA+ justfloat协议数据上报接口。支持单个函数上报任意多个通道的数据。 - **Primary Language**: Unknown - **License**: WTFPL - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-24 - **Last Updated**: 2025-09-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 使用说明: 1.基于可变参数实现的VOFA+ justfloat协议数据上报接口。支持单个函数上报任意多个通道的数据。 2.传入一个basic_framework下标准的串口实例`USARTInstance`,函数会向该实例按justfloat协议上报cnt个通道的数据。 3.由于使用了可变参数,所以变量数目可以任意,但是一个多任务循环中只能调用一次该函数(justfloat协议特征决定的),具体见使用实例 使用实例: 正确使用: ```c justfloat_report(report_, 3, motor_yaw->measure.total_angle, motor_pitch->measure.total_angle, motor_roll->measure.total_angle); ``` ```c justfloat_report(report_, 2, motor_yaw->measure.total_angle, motor_pitch->measure.total_angle); ``` 以上两种写法都是合法的,因为可变参数允许函数获取任意多个参数。 错误使用: ```c void TaskA(void *argument) { // 其他代码 justfloat_report(report_, 3, motor_yaw->measure.total_angle, motor_pitch->measure.total_angle, motor_roll->measure.total_angle); } void TaskB(void *argument) { // 其他代码 justfloat_report(report_, 2, motor_yaw->measure.total_angle, motor_pitch->measure.total_angle); } // 即:在两个不同的同时执行的任务中用该函数上报通道数不同的数据 ``` 由于justfloat协议会按tail来分割数据流,如果按上面这么写会导致通道数频繁切换,收到的数据是乱的。 如果有多个任务中的数据要同时上报,建议统一发到一个话题,然后在一个任务中订阅话题并上报数据。