使用USB输出时间和步数同步,一组十个字节,帧头0d ff,前四个字节编码器值,后四个字节是时间ms

This commit is contained in:
wantong
2024-04-26 10:03:33 +08:00
parent ca98807af3
commit c81173d0bd
89 changed files with 19992 additions and 4236 deletions

View File

@ -19,7 +19,7 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "usart.h"
#include "stdio.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
@ -164,21 +164,21 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
}
/* USER CODE BEGIN 1 */
#define SEND_COUNT 5
volatile uint32_t sendCount = 0;
uint8_t data = 16;
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
if (huart->Instance == USART1)
{
sendCount++; // 每次传输完成增加计数
if (sendCount >= SEND_COUNT)
{
// 达到指定次数后停止传
}
}
}
//#define SEND_COUNT 5
//volatile uint32_t sendCount = 0;
//uint8_t data = 16;
//void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
//{
// if (huart->Instance == USART1)
// {
// sendCount++; // 每次传输完成增加计数
//
// if (sendCount >= SEND_COUNT)
// {
// // 达到指定次数后停止传<EFBFBD>?
//
//
// }
// }
//}
/* USER CODE END 1 */