summaryrefslogtreecommitdiff
path: root/com32/lib/vdprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/vdprintf.c')
-rw-r--r--com32/lib/vdprintf.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/com32/lib/vdprintf.c b/com32/lib/vdprintf.c
index 76da012d..bcf55bb7 100644
--- a/com32/lib/vdprintf.c
+++ b/com32/lib/vdprintf.c
@@ -10,9 +10,7 @@
#include <sys/io.h>
#include <sys/cpu.h>
-#undef DEBUG
-#define DEBUG 1
-#include <dprintf.h>
+#ifdef DEBUG_PORT
#define BUFFER_SIZE 4096
@@ -31,10 +29,6 @@ enum serial_port_regs {
SCR = 7,
};
-#ifndef DEBUG_PORT
-# define DEBUG_PORT 0x03f8 /* I/O base address */
-#endif
-
static const uint16_t debug_base = DEBUG_PORT;
static void debug_putc(char c)
@@ -49,14 +43,13 @@ static void debug_putc(char c)
void vdprintf(const char *format, va_list ap)
{
- int rv, _rv;
+ int rv;
char buffer[BUFFER_SIZE];
char *p;
static bool debug_init = false;
static bool debug_ok = false;
- _rv = rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
-
+ rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
if (rv < 0)
return;
@@ -113,6 +106,6 @@ void vdprintf(const char *format, va_list ap)
p = buffer;
while (rv--)
debug_putc(*p++);
-
- _fwrite(buffer, _rv, stdout);
}
+
+#endif /* DEBUG_PORT */