/* Transmits a character. It silently fails if the TX fifo is not ready after a number of retries.  */
static void ug_putc(char ch)
/* Transmits a character. It silently fails if the TX fifo is not ready after a number of retries.  */
static void ug_putc(char ch)
{
	int count = UG_WRITE_ATTEMPTS;
	if (!ug_io_base)
		return;
	if (ch == '\n')
		ug_putc('\r');
	while (!ug_is_txfifo_ready() && count--)
		barrier();
	if (count >= 0)
		ug_raw_putc(ch);
}