diff --git a/application.c b/application.c index 855f2d7..27fb18a 100644 --- a/application.c +++ b/application.c @@ -39,7 +39,9 @@ /* own libraries */ #include "global.h" // board definitions #include "print.h" // printing utilities +#if !defined(STLINKV2_ALU) #include "uart.h" // USART utilities +#endif #include "usb_cdcacm.h" // USB CDC ACM utilities #include "terminal.h" // handle the terminal interface #include "menu.h" // menu utilities @@ -58,12 +60,16 @@ size_t putc(char c) static char last_c = 0; // to remember on which character we last sent if ('\n' == c) { // send carriage return (CR) + line feed (LF) newline for each LF if ('\r' != last_c) { // CR has not already been sent +#if !defined(STLINKV2_ALU) uart_putchar_nonblocking('\r'); // send CR over USART +#endif usb_cdcacm_putchar('\r'); // send CR over USB length++; // remember we printed 1 character } } +#if !defined(STLINKV2_ALU) uart_putchar_nonblocking(c); // send byte over USART +#endif usb_cdcacm_putchar(c); // send byte over USB length++; // remember we printed 1 character last_c = c; // remember last character @@ -257,7 +263,9 @@ void main(void) #endif board_setup(); // setup board +#if !defined(STLINKV2_ALU) uart_setup(); // setup USART (for printing) +#endif usb_cdcacm_setup(); // setup USB CDC ACM (for printing) printf("\nwelcome to the CuVoodoo STM32F1 example application\n"); // print welcome message