void printu(const char* fmt, ...) { u8 idata d; u8 idata ch=0; va_list ap; const u8 idata * s; //disable_ext_int1; disable_all_int; va_start(ap,fmt); //this macro is in stdarg.hÐ while (*fmt) { if (*fmt != '%') { uart_tx_byte(*fmt++); continue; } switch (*++fmt) { case 's': s = va_arg(ap,const u8 *);//get the next argument for (; *s; s++) uart_tx_byte(*s); break; case 'x': d = va_arg(ap,u8); uart_print_byte(d); break; case 'c': ch = va_arg(ap,u8); uart_tx_byte(ch); break; default: uart_tx_byte(*fmt); break; } fmt++; } va_end(ap); delay(200); //enable_ext_int1 enable_all_int; }
static void putchar(int c) { if (c == '\n') { putchar('\r'); } #if 0 uart_tx_byte(c); #endif }
/* FIXME: need to make console driver more generic */ void console_tx_byte(unsigned char byte) { if (byte == '\n') console_tx_byte('\r'); #if CONFIG_CONSOLE_SERIAL8250MEM if (oxford_oxpcie_present) { uart8250_mem_tx_byte( CONFIG_OXFORD_OXPCIE_BASE_ADDRESS + 0x1000, byte); } #endif #if CONFIG_CONSOLE_SERIAL8250 uart8250_tx_byte(CONFIG_TTYS0_BASE, byte); #endif #if CONFIG_CONSOLE_SERIAL_UART uart_tx_byte(byte); #endif #if CONFIG_USBDEBUG usbdebug_tx_byte(0, byte); #endif #if CONFIG_CONSOLE_CBMEM && !defined(__BOOT_BLOCK__) cbmemc_tx_byte(byte); #endif }
void console_tx_byte(unsigned char byte) { if (byte == '\n') uart_tx_byte('\r'); uart_tx_byte(byte); }
void dummy(void) { uart_tx_byte(5); }
void __console_tx_char(unsigned char byte) { uart_tx_byte(byte); }