STM/Modbus/Baremetal/UART_RS485_Modbus_Slave/Source/Modbus/Slave/Modbus_Slave.c
void MBSendData(unsigned char count)	//Send final data over UART
{
	if (data_in[0] != 0)
	{
#if 0
		for (unsigned char c = 0; c < count; c++)
		{
			while (!( USART2->ISR & (1 << 7u)))
			{
			};	//wait till transmit buffer is empty
			USART2->TDR = data_in[c];
		}
#else
		if(count > 0)
		{
			MBSendDataOnUART((uint8_t *)data_in, count);
		}
#endif
	}
}
//Send data over USART (RS232)

Send data over USART (RS232)
Send data over USART ( RS232 )
void MBSendData(unsigned char count)	
{
	if (data_in[0] != 0)
	{
#if 0
		for (unsigned char c = 0; c < count; c++)
		{
			while (!( USART2->ISR & (1 << 7u)))
			{
			};	
			USART2->TDR = data_in[c];
		}
#else
		if(count > 0)
		{
			MBSendDataOnUART((uint8_t *)data_in, count);
		}
#endif
	}
}
void MBSendData ( unsigned char count ) { if ( data_in [ 0 ] != 0 ) { #if 0 for ( unsigned char c = 0 ; c < count ; c ++ ) { while ( ! ( USART2 -> ISR & ( 1 << 7u ) ) ) { } ; USART2 -> TDR = data_in [ c ] ; } #else if ( count > 0 ) { MBSendDataOnUART ( ( uint8_t * ) data_in , count ) ; } #endif } }
Send data over USART (RS232)
Send data over USART ( RS232 )
//Send final data over UART
 //wait till transmit buffer is empty
