コード例 #1
0
ファイル: ugecon.c プロジェクト: 1703011/asuswrt-merlin
void ug_console_write(const char *buf, int len)
{
	char *b = (char *)buf;

	while (len--) {
		if (*b == '\n')
			ug_putc('\r');
		ug_putc(*b++);
	}
}
コード例 #2
0
ファイル: usbgecko_udbg.c プロジェクト: CSCLOG/beaglebone
/*
 * 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);
}
コード例 #3
0
/*
 * Trasmits a null terminated character string.
 */
static void ug_puts(char *s)
{
	while (*s)
		ug_putc(*s++);
}