/* Write a character trought UART in a blocking call. */
static int32_t usr_uart_write_block(struct uart_desc *desc, uint8_t data)
/* Write a character trought UART in a blocking call. */
static int32_t usr_uart_write_block(struct uart_desc *desc, uint8_t data)
{
	int32_t ret;
	const uint32_t buf_size = 1;
	uint32_t hw_error;
	if(desc->has_callback) {
		ret = adi_uart_SubmitTxBuffer((ADI_UART_HANDLE const)h_uart_device,
					      &data, buf_size, DMA_NOT_USE);
		if(ret != ADI_UART_SUCCESS)
			return ret;
		tx_done++;
		while(tx_done > 0);
		if(tx_done == 0)
			return 0;
		else
			return -1;
	} else {
		return adi_uart_Write((ADI_UART_HANDLE const)h_uart_device, &data,
				      buf_size, DMA_NOT_USE, &hw_error);
	}
}