使用USB输出时间和步数同步,一组十个字节,帧头0d ff,前四个字节编码器值,后四个字节是时间ms
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user