Stop Transmit interrupt manually during transmitting
Hi
I'm doing a project to detect collision on UART, when I get data from Rx, I will compare it with the data I transmitted, if there aren't the same, means collision occurred, then I will immediately stop my transmitting interrupt to stop sources waste on the bus.
I am using
HAL_UART_Transmit_IT(&huart1, Message1.data, length);to transmit data,
I tried
UART_EndTransmit_IT(huart);, but this function is not declared in main, so I directly write
CLEAR_BIT(huart1.Instance->CR1, USART_CR1_TCIE);
huart1.gState = HAL_UART_STATE_READY;but the result is when I detected collision, the transmit yes stop, but then I recall HAL_UART_Transmit_IT(&huart1, Message1.data, length); transmit is not working, is there any more register I need to clear? or are there any other way to stop transmit interrupt during transmitting?
