Browse Source

Merge pull request #171 from gsmcmullin/v2_usb_uart_check

Don't enable usb uart on v2 when debugging
pull/175/head
Gareth McMullin 8 years ago
committed by GitHub
parent
commit
b745799156
  1. 8
      src/platforms/native/platform.c
  2. 8
      src/platforms/stm32/usbuart.c

8
src/platforms/native/platform.c

@ -164,7 +164,12 @@ void platform_init(void)
platform_timing_init();
cdcacm_init();
usbuart_init();
/* On mini hardware, UART and SWD share connector pins.
* Don't enable UART if we're being debugged. */
if ((platform_hwversion() == 0) || !(SCS_DEMCR & SCS_DEMCR_TRCENA))
usbuart_init();
setup_vbus_irq();
}
@ -347,4 +352,3 @@ asm(".globl debug_monitor_handler\n"
" b debug_monitor_handler_c\n");
#endif

8
src/platforms/stm32/usbuart.c

@ -46,13 +46,6 @@ static void usbuart_run(void);
void usbuart_init(void)
{
#if defined(BLACKMAGIC)
/* On mini hardware, UART and SWD share connector pins.
* Don't enable UART if we're being debugged. */
if ((platform_hwversion() == 1) && (SCS_DEMCR & SCS_DEMCR_TRCENA))
return;
#endif
rcc_periph_clock_enable(USBUSART_CLK);
UART_PIN_SETUP();
@ -257,4 +250,3 @@ void USBUSART_TIM_ISR(void)
/* process FIFO */
usbuart_run();
}

Loading…
Cancel
Save