From: Michael Gernoth Date: Sun, 22 Aug 2010 22:40:19 +0000 (+0200) Subject: don't initialize usart when not debugging X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rsbs2/commitdiff_plain/594d42a7b04f9f092d9a67bd3910442dc68f800b don't initialize usart when not debugging --- diff --git a/bmc/usart.c b/bmc/usart.c index 36ba83c..f92edbd 100644 --- a/bmc/usart.c +++ b/bmc/usart.c @@ -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<