X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rsbs2/blobdiff_plain/d6f38d0dfc4f602a6c790fd470deb2b2fd23da77..5bece6bf8c66ade0960290b6fe75623da7968e09:/bmc/usart.c diff --git a/bmc/usart.c b/bmc/usart.c index 36ba83c..605c794 100644 --- a/bmc/usart.c +++ b/bmc/usart.c @@ -1,8 +1,11 @@ #include #include +#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<