38 lines
546 B
C
38 lines
546 B
C
#include "stdio.h"
|
|
#include "protect.h"
|
|
#include "proc.h"
|
|
#include "global.h"
|
|
#include "proto.h"
|
|
#include "tty.h"
|
|
#include "serialport.h"
|
|
|
|
static void kprintfputch(int ch, int *cnt)
|
|
{
|
|
// write_serial(ch);
|
|
#ifndef USE_FBCON
|
|
char _ch = ch;
|
|
tty_write(cur_ntty, &_ch, 1);
|
|
#endif
|
|
(*cnt)++;
|
|
}
|
|
|
|
int vkprintf(const char *fmt, va_list ap)
|
|
{
|
|
|
|
int cnt = 0;
|
|
vprintfmt((void *)kprintfputch, &cnt, fmt, ap);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int kprintf(const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
int rc;
|
|
|
|
va_start(ap, fmt);
|
|
rc = vkprintf(fmt, ap);
|
|
va_end(ap);
|
|
|
|
return rc;
|
|
} |