![]() You know, a common solution to this is to use some thermistor and transmit a low level signal for at least 1us, then transmit the corresponding signal, the whole transmit time should takes longer than 60us. I'm trying to add some temperature sensor to my STM32-based computer water-cooling controller.So, I decided to use an interrupt for uart transmission HAL_UART_Transmit_IT()instead of a blocking call. Secondly, HAL_UART_Transmit() is a blocking call and it is not advisable to use blocking calls inside an interrupt. This problem can be solved as follows: Get the packet -> the interrupt is triggered -> immediately in the interrupt UART disable the same interrupt -> set the flag "data ready" -> exit the interrupt uart -> check the flag "data ready" in the main program -> process the received packet as long as necessary -> enable the interrupt UART -> wait. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |