ECU/GSM/dist/src/USART_program.c
void USART_voidSendString(u8 Channel, const char* Message) {
	volatile UART_REG * selectedChannel = USART1;

	switch(Channel) {
		case 1:
			;
			break;
		case 2:
			selectedChannel = USART2;
			break;
		case 3:
			selectedChannel = USART3;
			break;
		case 4:
			selectedChannel = USART4;
			break;
		case 5:
			selectedChannel = USART5;
			break;
		default:
			return;
	}

	u8 currentPos = 0;
	while (Message[currentPos] != '\0') {
		USART_voidSend(selectedChannel, Message[currentPos++]);
	}

	while(!GET_BIT(selectedChannel->SR, 6));	// Wait transmission is not completed
}
/**
  * @brief  Sends a string ended CR and NL
  * @param  Channel:	Number of the UART Channel to use.
  * 					Can be USART_CHANNEL_x where x is from 1 to 5
  * @param	Message: The String to be sent
  * @retval void
  */
@brief  Sends a string ended CR and NL
@param  Channel:    Number of the UART Channel to use.
Can be USART_CHANNEL_x where x is from 1 to 5
@param      Message: The String to be sent
@retval void
@brief Sends a string ended CR and NL @param Channel : Number of the UART Channel to use . Can be USART_CHANNEL_x where x is from 1 to 5 @param Message : The String to be sent @retval void
void USART_voidSendString(u8 Channel, const char* Message) {
	volatile UART_REG * selectedChannel = USART1;
	switch(Channel) {
		case 1:
			;
			break;
		case 2:
			selectedChannel = USART2;
			break;
		case 3:
			selectedChannel = USART3;
			break;
		case 4:
			selectedChannel = USART4;
			break;
		case 5:
			selectedChannel = USART5;
			break;
		default:
			return;
	}
	u8 currentPos = 0;
	while (Message[currentPos] != '\0') {
		USART_voidSend(selectedChannel, Message[currentPos++]);
	}
	while(!GET_BIT(selectedChannel->SR, 6));	
}
void USART_voidSendString ( u8 Channel , const char * Message ) { volatile UART_REG * selectedChannel = USART1 ; switch ( Channel ) { case 1 : ; break ; case 2 : selectedChannel = USART2 ; break ; case 3 : selectedChannel = USART3 ; break ; case 4 : selectedChannel = USART4 ; break ; case 5 : selectedChannel = USART5 ; break ; default : return ; } u8 currentPos = 0 ; while ( Message [ currentPos ] != ' \0 ' ) { USART_voidSend ( selectedChannel , Message [ currentPos ++ ] ) ; } while ( ! GET_BIT ( selectedChannel -> SR , 6 ) ) ; }
@brief  Sends a string ended CR and NL
 @param  Channel:    Number of the UART Channel to use.
@brief Sends a string ended CR and NL @param Channel : Number of the UART Channel to use .
// Wait transmission is not completed