1 Star 10 Fork 12

GuanGuan / 无感浮点FOC开源库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
FocDebug.c 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
GuanGuan 提交于 2023-06-21 07:45 . V1.0.0
#include "FocDebug.h"
#include "main.h"
#include "string.h"
VofaProtocol_t gVofa;
/*******************************************************************************
* @brief 日志 曲线初始化
* @param
* @return
******************************************************************************/
void DebugLogInit(void)
{
}
unsigned char SumCheck(unsigned char data[], int count)
{
int sum = 0;
for (int i = 0; i < count; i++)
{
sum += data[i];
}
return (unsigned char)(sum & 0xFF);
}
/*******************************************************************************
* @brief 拷贝曲线信息
* @param
* @return
******************************************************************************/
void GraphDataCopy(float *buff,int count)
{
gVofa.sendFlag = 1;
for(int i = 0;i < count;i++)
{
gVofa.graph[i] = buff[i];
}
}
/*******************************************************************************
* @brief 发送曲线信息
* @param
* @return
******************************************************************************/
unsigned char tbuf[60];
extern UART_HandleTypeDef huart2;
void VofaGraphSend(int graphCount)
{
int len = sprintf((char*)tbuf,"%0.2f,%.2f,%.2f\n",gVofa.graph[0],gVofa.graph[1],gVofa.graph[2]);
HAL_UART_Transmit(&huart2,tbuf,len,1000);
//HAL_UART_Transmit(&huart2,"1234",4,1000);
}
C
1
https://gitee.com/guanmingweiabc/foc_float.git
git@gitee.com:guanmingweiabc/foc_float.git
guanmingweiabc
foc_float
无感浮点FOC开源库
master

搜索帮助