Merge pull request #91 from schodet/usb-vbus

Fix usage of USB_VBUS
This commit is contained in:
Gareth McMullin 2017-04-18 08:22:57 +12:00 committed by GitHub
commit e5395aaba7
2 changed files with 4 additions and 5 deletions

View File

@ -55,9 +55,8 @@ void platform_init(void)
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_CRCEN);
/* Set up USB Pins and alternate function*/
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE,
GPIO9 | GPIO11 | GPIO12);
gpio_set_af(GPIOA, GPIO_AF10, GPIO9 | GPIO11 | GPIO12);
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO11 | GPIO12);
gpio_set_af(GPIOA, GPIO_AF10, GPIO11 | GPIO12);
GPIOC_OSPEEDR &=~0xF30;
GPIOC_OSPEEDR |= 0xA20;

View File

@ -60,8 +60,8 @@ int main(void)
/* Set up USB Pins and alternate function*/
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE,
GPIO9 | GPIO10 | GPIO11 | GPIO12);
gpio_set_af(GPIOA, GPIO_AF10, GPIO9 | GPIO10| GPIO11 | GPIO12);
GPIO10 | GPIO11 | GPIO12);
gpio_set_af(GPIOA, GPIO_AF10, GPIO10 | GPIO11 | GPIO12);
dfu_init(&stm32f107_usb_driver);
dfu_main();