Esempio n. 1
0
serial_print(const char *str)
{
	uint8_t end = serial_output.end;

	while ((serial_output.buf[end] = *str++))
		end = (end + 1) & (SERIAL_OUTBUF - 1);

	serial_output.end = end;
	serial_interrupt_dre_enable();
}
Esempio n. 2
0
static void
serial_puts(const char *str)
{
	uint8_t end = serial_output.end;

	while ((serial_output.buf[end] = *str++))
		end = (end + 1) % sizeof(serial_output.buf);

	serial_output.end = end;
	serial_interrupt_dre_enable();
}
Esempio n. 3
0
serial_hexdump(const void *data, uint8_t len)
{
	const uint8_t *p = data;
	uint8_t end = serial_output.end;

	for (; len > 0; len--, p++) {
		uint8_t c = *p;

		serial_output.buf[end] = serial_hexdigit[c >> 4];
		end = (end + 1) & (SERIAL_OUTBUF - 1);
		serial_output.buf[end] = serial_hexdigit[c & 0x0F];
		end = (end + 1) & (SERIAL_OUTBUF - 1);
	}

	serial_output.end = end;
	serial_interrupt_dre_enable();
}
Esempio n. 4
0
static void
serial_puts(char *str)
{
    output.str = str;
    output.printing = 1;

    serial_interrupt_dre_enable();

again:
    cli();
    if (output.printing) {
        sleep_enable();
        sei();
        sleep_cpu();
        sleep_disable();
        goto again;
    }
    sei();
}