From 5d9d373a959271b498710817d08c2ea8e153aa6e Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Thu, 13 Oct 2011 20:33:30 +0200 Subject: correct firmware?? --- firmware/debug.c | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) (limited to 'firmware/debug.c') diff --git a/firmware/debug.c b/firmware/debug.c index 5e7a950..539a3e2 100644 --- a/firmware/debug.c +++ b/firmware/debug.c @@ -1,7 +1,4 @@ #include -#include -#include -#include #include #include "uart.h" @@ -11,39 +8,21 @@ #define UART_PORT 0 -void debug_dummy(char *fmt, ...) {} - -void debug_init() -{ -#ifdef DEBUG -#warning Compiling with debug-support! +void debug_init(void) { uart_init(UART_PORT); uart_baudrate(UART_PORT, 25, 0, 0, 0); uart_stopbits(UART_PORT, 1); uart_databits(UART_PORT, 8); uart_parity(UART_PORT, 'N'); - - static FILE mystdout = FDEV_SETUP_STREAM(debug_putchar, NULL, - _FDEV_SETUP_WRITE); - stdout = &mystdout; -#endif } -int debug_putchar(char c, FILE *stream) -{ -#ifdef DEBUG - if (c == '\n') - uart_putchar(UART_PORT, '\r'); - uart_putchar(UART_PORT, c); -#endif - return 1; +void debug_deinit(void) { + uart_deinit(UART_PORT); } -void debug_deinit(void) -{ -#ifdef DEBUG - uart_deinit(UART_PORT); -#endif +void debug_write(char *buf) { + while(*buf) + uart_putchar(UART_PORT, *buf++); } unsigned char debug_AsciiToHex(unsigned char high, unsigned char low) @@ -73,7 +52,6 @@ unsigned char debug_AsciiToHex(unsigned char high, unsigned char low) void debug_SendHex(unsigned char hex) { -#ifdef DEBUG unsigned char high,low; // get highnibble high = hex & 0xF0; @@ -91,8 +69,4 @@ void debug_SendHex(unsigned char hex) uart_putchar(UART_PORT, low+48); else uart_putchar(UART_PORT, low+87); - - //_debug_write("\r\n"); -#endif } - -- cgit v1.2.1