]> git.zerfleddert.de Git - rsbs2/blobdiff - bmc/usart.c
implement all remaining IPMB queries seen on the wire
[rsbs2] / bmc / usart.c
index 36ba83c6b127339fa9a982a83772fc1892539a38..605c7944a268b834ef3b2c9cecbb103e56e427f9 100644 (file)
@@ -1,8 +1,11 @@
 #include <avr/io.h>
 #include <stdio.h>
 
+#include "config.h"
 #include "usart.h"
 
+#ifdef DEBUG
+
 #define UBRR_VAL ((F_CPU+BAUD*8)/(BAUD*16)-1)
 #define BAUD_REAL (F_CPU/(16*(UBRR_VAL+1)))
 #define BAUD_ERROR ((BAUD_REAL*1000)/BAUD)
@@ -22,9 +25,11 @@ int usart_put(char c, FILE *stream)
 }
 
 static FILE usart_stdout = FDEV_SETUP_STREAM(usart_put, NULL, _FDEV_SETUP_WRITE);
+#endif
 
 void usart_init()
 {
+#ifdef DEBUG
        UCSRB |= (1<<TXEN);
        UCSRC |= (1<<URSEL)|(1 << UCSZ1)|(1 << UCSZ0);
 
@@ -32,4 +37,5 @@ void usart_init()
        UBRRL = UBRR_VAL & 0xFF;
 
        stdout = &usart_stdout;
+#endif
 }
Impressum, Datenschutz