2021-03-09 07:43 AM
I am using STM32F429 in my project which connects to an ATmega2560 thru UART. In arduino, there is a function Serial.Available() to check if the serial buffer is empty or not.
Is there a function in STM32 that is similar to Serial.Available() in Arduino?
BTW, I am using HAL libraries in STM32CubeIDE and HAL_UART_Receive(huart, pData, Size, Timeout) to read the contents of UART buffer.
Please help. Thanks!
PS. I've read the documentation in HAL library but I'm not sure if there is one. I've looked into HAL_UART_GetState but Im not sure.
Solved! Go to Solution.
2021-03-10 05:59 AM
>>But I feel this is not very efficient
Right you've got a lot of depth from compound statements, you really need to flatten this, and manage sequence/flow via states