What`s the difference between Transmit_IT function and Transmit function?
MCU:STM32F0discovery
Tools:STM32CubeMX5.6.1+Keil5.3
OS: Windows 10pro
Question:
When I use the PLC system`s interrupt, always the interrupt just trigger once in the first scan time.
But in the MCU system, I find that the interrupt can be triggered by the loop cycle.And
when I use the Transmit_IT function and Transmit function as below, I find that the Transmit function couldn`t be used as normal, the CR word couldn`t be printed to the serial handshake software.
Does it mean that the Transmit_IT function and the transmit function use the same transmit memory,and when the transmit function is not hold in the while loop, the transmit function is disable in the communication process.
What`s the attitude about it from sincerely yours?
int main(void)
{
uint8_t CR_message[]="\r\n";
HAL_UART_Receive_IT(&huart1,(uint8_t *)aRxBuffer,10);
while(1)
{
if(huart1.RxState==HAL_UART_STATE_BUSY_RX)
{
Test_Retention=1;
Test_Follow=1;
}
else
Test_Follow=0;
if((Test_Retention==1)&&(Test_Follow==0))
{
HAL_UART_Transmit_IT(&huart1,(uint8_t *)aRxBuffer,sizeof(aRxBuffer));
HAL_UART_Transmit(&huart1,(uint8_t *)CR_message,sizeof(CR_message),10000);
HAL_UART_Receive_IT(&huart1,(uint8_t *)aRxBuffer,10);
Test_Retention=0;
}
}
}
