Merge pull request #171 from gsmcmullin/v2_usb_uart_check

Don't enable usb uart on v2 when debugging
This commit is contained in:
Gareth McMullin 2016-11-22 13:20:24 +13:00 committed by GitHub
commit b745799156
2 changed files with 6 additions and 10 deletions

View File

@ -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

View File

@ -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();
}