加入串口接收

This commit is contained in:
不吃油炸鸡
2025-10-19 12:00:28 +08:00
parent 548db44f01
commit 82f489bf5c
3 changed files with 13 additions and 3 deletions

View File

@@ -21,9 +21,11 @@
#include "usart.h"
/* USER CODE BEGIN 0 */
#include "stdio.h"
// memeory for receive string
uint8_t uart_receive_str[USART_RX_BUFFER_SIZE + 1];
uint8_t uart_receive_buf[USART_RX_BUFFER_SIZE + 1];
uint8_t uart_receive_flag = 0; // flag for receive complete
/* USER CODE END 0 */
@@ -162,6 +164,12 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
/* USER CODE BEGIN 1 */
int fputc(int ch, FILE *f)
{
HAL_UART_Transmit(&huart6, (uint8_t *)&ch, 1, 0xffff);
return ch;
}
//串口6发送
void UART6_TX_Send(uint8_t *buffer, uint16_t length)
{