I want to detect a timeout after execution of HAL_UART_Receive_IT and execute the transmission, is there a good way to do this?
(I am translating Japanese to English with deepl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-09-11 06:09 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-09-20 10:01 AM
Hi @豊和 金�? welcome to the Community :),
When you used the Hal UART with Interrupt mode, the callback functions are declared as weak functions in the driver, with no code to execute. This means that the user can declare the Tx / Rx callback again in the application and customize it to be informed in real-time about the process completion and to execute some application code. Contrary, when you used the Hal UART with polling mode, the data processing is handled internally in a loop. A timeout (expressed in ms) is used to prevent process hanging.
For more explanation, you can refer to this article.
Also, I advise you to take a look at this example.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-09-20 10:01 AM
Hi @豊和 金�? welcome to the Community :),
When you used the Hal UART with Interrupt mode, the callback functions are declared as weak functions in the driver, with no code to execute. This means that the user can declare the Tx / Rx callback again in the application and customize it to be informed in real-time about the process completion and to execute some application code. Contrary, when you used the Hal UART with polling mode, the data processing is handled internally in a loop. A timeout (expressed in ms) is used to prevent process hanging.
For more explanation, you can refer to this article.
Also, I advise you to take a look at this example.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.