DFU: fix DP pull down

This commit is contained in:
King Kévin 2020-11-27 16:05:55 +01:00
parent 8918b97618
commit de36c7f3a2
1 changed files with 2 additions and 2 deletions

View File

@ -132,8 +132,8 @@ static void usb_disconnect(void)
}
// pull USB D+ low for a short while
rcc_periph_clock_enable(RCC_GPIOA);
gpio_mode_setup(GPIO_PORT(LED_PIN), GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN(LED_PIN));
gpio_set_output_options(GPIO_PORT(LED_PIN), GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO_PIN(LED_PIN));
gpio_mode_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO12);
gpio_set_output_options(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO12);
gpio_clear(GPIOA, GPIO12);
// USB disconnected must be at least 10 ms long, at most 100 ms
for (volatile uint32_t i = 0; i < 0x8000; i++);