加入大疆C板例程bsp

This commit is contained in:
2026-04-12 20:34:47 +08:00
parent 7475077b9e
commit b68ac54a34
51 changed files with 5950 additions and 1290 deletions

28
bsp/boards/bsp_uart.c Normal file
View File

@@ -0,0 +1,28 @@
/**
* @brief uart板级支持包
* @author Penguin
*/
#include "bsp_uart.h"
/**
* @brief 使用uart发送数据
* @param huart
* @param pData
* @param Size
* @param Timeout
* @return
*/
UartSendState_e UartSendTxMessage(
UART_HandleTypeDef * huart, uint8_t * pData, uint16_t Size, uint32_t Timeout)
{
uint8_t cnt = 5; //最大重发次数
HAL_StatusTypeDef status = HAL_UART_Transmit(huart, pData, Size, Timeout);
while (cnt-- && status != HAL_OK) {
status = HAL_UART_Transmit(huart, pData, Size, Timeout);
}
if (status == HAL_OK) {
return UART_SEND_OK;
}
return UART_SEND_FAIL;
}