]> git.zerfleddert.de Git - rsbs2/commitdiff
don't initialize usart when not debugging
authorMichael Gernoth <michael@gernoth.net>
Sun, 22 Aug 2010 22:40:19 +0000 (00:40 +0200)
committerMichael Gernoth <michael@gernoth.net>
Sun, 22 Aug 2010 22:40:19 +0000 (00:40 +0200)
bmc/usart.c

index 36ba83c6b127339fa9a982a83772fc1892539a38..f92edbdda41d7bae4210a62189a9a4c462dd6883 100644 (file)
@@ -3,6 +3,8 @@
 
 #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 +24,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 +36,5 @@ void usart_init()
        UBRRL = UBRR_VAL & 0xFF;
 
        stdout = &usart_stdout;
+#endif
 }
Impressum, Datenschutz