TelenkovDmitry пре 7 година
родитељ
комит
a98c135ade
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      peripheral_modules/src/usart.c

+ 7 - 0
peripheral_modules/src/usart.c

@@ -19,7 +19,12 @@
 #include "FreeRTOS.h"
 #include "semphr.h"
 
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
 #include "tinystdio.h"
+#endif
 
 #ifdef BT6702_SERVICE
 #define UPS_RBUF_SIZE 1024
@@ -97,7 +102,9 @@ void InitUSART(void) {
 	rbuf32_init(&user_tx_rbuf, user_tx_fifo, USER_RBUF_SIZE);
 	rbuf32_init(&user_rx_rbuf, user_rx_fifo, USER_RBUF_SIZE);
 	uart_hw_init(USER_USART, USER_USART_BAUD, USER_USART_WORD_LEN, USER_USART_PARITY, USER_USART_STOP_BIT);
+#ifdef PRINTF_CUSTOM    
 	init_printf(NULL, putc_);
+#endif
 }
 
 void ups_putchar(uint16_t byte) {