aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32f1/usbserial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-02-01 10:14:56 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-02-06 22:03:09 -0500
commiteb8db46ca3dc23286da5cf5e1c23af2456080172 (patch)
treea594111424e8a51ed3b5082254282cfb35524aef /src/stm32f1/usbserial.c
parent1096075d9b2d10302abd42cfdeef155f145f64e1 (diff)
downloadkutter-eb8db46ca3dc23286da5cf5e1c23af2456080172.tar.gz
kutter-eb8db46ca3dc23286da5cf5e1c23af2456080172.tar.xz
kutter-eb8db46ca3dc23286da5cf5e1c23af2456080172.zip
stm32f1: Use internal functions for early USB gpio toggle
Avoid using the "low-level" library timing utilities. This is in preparation for using SysTick as part of the timer implementation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32f1/usbserial.c')
-rw-r--r--src/stm32f1/usbserial.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/stm32f1/usbserial.c b/src/stm32f1/usbserial.c
index 20e1da0d..641aacc0 100644
--- a/src/stm32f1/usbserial.c
+++ b/src/stm32f1/usbserial.c
@@ -5,13 +5,13 @@
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <string.h> // NULL
+#include "board/gpio.h" // gpio_out_setup
#include "board/io.h" // writeb
#include "board/usb_cdc.h" // usb_notify_ep0
#include "board/usb_cdc_ep.h" // USB_CDC_EP_BULK_IN
+#include "internal.h" // GPIO
#include "sched.h" // DECL_INIT
#include "stm32f1xx.h" // USB
-#include "stm32f1xx_ll_gpio.h" // LL_GPIO_SetOutputPin
-#include "stm32f1xx_ll_utils.h" // LL_mDelay
/****************************************************************
@@ -226,10 +226,9 @@ void
usb_init(void)
{
// Pull the D+ pin low briefly to signal a new connection
- LL_GPIO_ResetOutputPin(GPIOA, LL_GPIO_PIN_12);
- LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_12, LL_GPIO_MODE_OUTPUT);
- LL_mDelay(5);
- LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_12, LL_GPIO_MODE_FLOATING);
+ gpio_out_setup(GPIO('A', 12), 0);
+ udelay(5000);
+ gpio_in_setup(GPIO('A', 12), 0);
// Setup USB packet memory
btable_configure();