aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/f4discovery/platform.c
diff options
context:
space:
mode:
authorGareth McMullin2015-03-02 10:16:33 -0800
committerGareth McMullin2015-03-02 10:16:33 -0800
commitb07ffffcee53e18051b324eb59a2794044ce6f95 (patch)
treed52ba33369d50f9011f286ad5ee9f0e895841e3e /src/platforms/f4discovery/platform.c
parent4d4813de87721528fc9a06174dd1da5c245ae2f3 (diff)
Factor out common cdcacm.c from stm32 and tm4c.
Cleaned up interface to enter bootloader and read serial number.
Diffstat (limited to 'src/platforms/f4discovery/platform.c')
-rw-r--r--src/platforms/f4discovery/platform.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/platforms/f4discovery/platform.c b/src/platforms/f4discovery/platform.c
index cf6cdf3..6e10ff4 100644
--- a/src/platforms/f4discovery/platform.c
+++ b/src/platforms/f4discovery/platform.c
@@ -46,7 +46,7 @@ void platform_init(void)
/* Check the USER button*/
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPAEN);
if(gpio_get(GPIOA, GPIO0)) {
- assert_boot_pin();
+ platform_request_boot();
scb_reset_core();
}
@@ -111,8 +111,12 @@ const char *platform_target_voltage(void)
return "ABSENT!";
}
-void assert_boot_pin(void)
+void platform_request_boot(void)
{
+ /* Disconnect USB cable */
+ usbd_disconnect(usbdev, 1);
+ nvic_disable_irq(USB_IRQ);
+
/* Assert blue LED as indicator we are in the bootloader */
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN);
gpio_mode_setup(LED_PORT, GPIO_MODE_OUTPUT,