2021-02-26 04:30 PM
I have been looking for something in the structure.
while ((huart1.hdmatx->State != HAL_DMA_STATE_READY) && (huart1.hdmatx->Lock != HAL_UNLOCKED))
But that does not seem to work.
The only other way I can think of is when you call HAL_UART_Transmit_DMA() set a variable to 1, and then setup a callback complete and set it to 0. Is that the best way to do it?
Solved! Go to Solution.
2021-02-27 01:19 AM
Hello
The HAL way (the best way depends to peogrammer) to know when HAL_UART_Transmit_DMA is finished , is when HAL_UART_TxCpltCallback(..) called by HAL.
2021-02-27 01:19 AM
Hello
The HAL way (the best way depends to peogrammer) to know when HAL_UART_Transmit_DMA is finished , is when HAL_UART_TxCpltCallback(..) called by HAL.
2021-02-28 10:15 AM
One should not use driver structures internal elements externally, because it's not thread safe and not future proof. The driver state is returned by HAL_UART_GetState(). Though that function is also not thread safe, as is almost everything in the broken HAL...