void Task1(void* args)
{
osDelay(1000);
char TxBf[] = "HelloDMA0";
//HAL_UART_Transmit_DMA(&huart1, (uint8_t*)TxBf, sizeof(TxBf));
while (1) {
//HAL_DMA_RegisterCallback(&hdma_usart1_tx, HAL_DMA_XFER_CPLT_CB_ID, Uart1_DMA_TxComplete);
HAL_UART_Transmit_DMA(&huart1, (uint8_t*)TxBf, sizeof(TxBf)-1);
//osEventFlagsWait(Uart1_Recv_Event, 01, osFlagsWaitAny, osWaitForever);
/*__HAL_DMA_CLEAR_FLAG(&hdma_usart1_tx, DMA_FLAG_TC4);
while (__HAL_DMA_GET_FLAG(&hdma_usart1_tx, DMA_FLAG_TC4) == 0);*/
while(huart1.gState != HAL_UART_STATE_READY)
{}
osDelay(1);
}
}
DMA发送字符串 串口助手显示数据错乱,原因是C语言字符最后有个\0 串口助手显示错乱
时段 | 个数 |
---|---|
{{f.startingTime}}点 - {{f.endTime}}点 | {{f.fileCount}} |