disable UART output for ST-Link V2 board
on ST-Link V2 USART1_TX is also the LED pin if you still want USART1 for debugging output, remap it USART1_TX will then be on RST pin of connector, USART1_RX will then be on SWIM pin of connector, remapping is not done per default since this board already has a limited number of pin available on the connector
This commit is contained in:
parent
a6ebf92b51
commit
c1bc2527bb
|
@ -39,7 +39,9 @@
|
||||||
/* own libraries */
|
/* own libraries */
|
||||||
#include "global.h" // board definitions
|
#include "global.h" // board definitions
|
||||||
#include "print.h" // printing utilities
|
#include "print.h" // printing utilities
|
||||||
|
#if !defined(STLINKV2_ALU)
|
||||||
#include "uart.h" // USART utilities
|
#include "uart.h" // USART utilities
|
||||||
|
#endif
|
||||||
#include "usb_cdcacm.h" // USB CDC ACM utilities
|
#include "usb_cdcacm.h" // USB CDC ACM utilities
|
||||||
#include "terminal.h" // handle the terminal interface
|
#include "terminal.h" // handle the terminal interface
|
||||||
#include "menu.h" // menu utilities
|
#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
|
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 ('\n' == c) { // send carriage return (CR) + line feed (LF) newline for each LF
|
||||||
if ('\r' != last_c) { // CR has not already been sent
|
if ('\r' != last_c) { // CR has not already been sent
|
||||||
|
#if !defined(STLINKV2_ALU)
|
||||||
uart_putchar_nonblocking('\r'); // send CR over USART
|
uart_putchar_nonblocking('\r'); // send CR over USART
|
||||||
|
#endif
|
||||||
usb_cdcacm_putchar('\r'); // send CR over USB
|
usb_cdcacm_putchar('\r'); // send CR over USB
|
||||||
length++; // remember we printed 1 character
|
length++; // remember we printed 1 character
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if !defined(STLINKV2_ALU)
|
||||||
uart_putchar_nonblocking(c); // send byte over USART
|
uart_putchar_nonblocking(c); // send byte over USART
|
||||||
|
#endif
|
||||||
usb_cdcacm_putchar(c); // send byte over USB
|
usb_cdcacm_putchar(c); // send byte over USB
|
||||||
length++; // remember we printed 1 character
|
length++; // remember we printed 1 character
|
||||||
last_c = c; // remember last character
|
last_c = c; // remember last character
|
||||||
|
@ -257,7 +263,9 @@ void main(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
board_setup(); // setup board
|
board_setup(); // setup board
|
||||||
|
#if !defined(STLINKV2_ALU)
|
||||||
uart_setup(); // setup USART (for printing)
|
uart_setup(); // setup USART (for printing)
|
||||||
|
#endif
|
||||||
usb_cdcacm_setup(); // setup USB CDC ACM (for printing)
|
usb_cdcacm_setup(); // setup USB CDC ACM (for printing)
|
||||||
printf("\nwelcome to the CuVoodoo STM32F1 example application\n"); // print welcome message
|
printf("\nwelcome to the CuVoodoo STM32F1 example application\n"); // print welcome message
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue