37 lines
570 B
C
37 lines
570 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 serialputch(int ch, int *cnt)
|
|
{
|
|
// write_serial(ch);
|
|
char _ch = ch;
|
|
tty_write(cur_ntty, &_ch, 1);
|
|
(*cnt)++;
|
|
}
|
|
|
|
int vkprintf(const char *fmt, va_list ap)
|
|
{
|
|
|
|
// vprintfmt((void*)kprintfputch, NULL, fmt, ap);
|
|
int cnt = 0;
|
|
vprintfmt((void *)serialputch, &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;
|
|
} |