Other Parts Discussed in Thread: EK-TM4C1294XL
I am taking over some code, and this part does not seem right to me. I don't think it's correct to sit and loop, waiting for the transmission to complete. Can anyone tell me how it should be done?
void XmitBfr_HB( void )
{
char ch;
unsigned int i;
Enable_UartPort_HB_Transmiter();
//In current Loop, everytime we transmit somthing, we need to discard one received message
// because the hardware is set to receive all messages including the ones we send
if(TTY20mA_Option==1)
{
msg_to_discard_HB++;
}
for( i = 0; i < 200 ; i++ ); // Allow time for hardware to switch.
for( i = 0 ; i < 300; i++)
{
ch = get_from_output_buffer_HB();
UARTCharPut(UartPort_HB ,ch);
while(UARTBusy(UartPort_HB)); // More data rdy?
if(out_wrptr_HB == out_rdptr_HB)
{
Disable_UartPort_HB_Transmiter();
break;
}
}
}