USB pins are not registered in pin_repository fix #797

This commit is contained in:
rusefi 2019-05-10 19:06:28 -04:00
parent f0350613da
commit 66f486c43b
3 changed files with 9 additions and 15 deletions

View File

@ -680,9 +680,9 @@
PIN_AFIO_AF(GPIOA_ARD_D11, 11U))
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_USB_SOF, 10U) | \
PIN_AFIO_AF(GPIOA_USB_VBUS, 0U) | \
PIN_AFIO_AF(GPIOA_PIN10, EFI_USB_AF) | \
PIN_AFIO_AF(GPIOA_PIN11, EFI_USB_AF) | \
PIN_AFIO_AF(GPIOA_PIN12, EFI_USB_AF) | \
PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
PIN_AFIO_AF(GPIOA_PIN11, 0U) | \
PIN_AFIO_AF(GPIOA_PIN12, 0U) | \
PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
PIN_AFIO_AF(GPIOA_ZIO_D20, 0U))

View File

@ -401,9 +401,9 @@
PIN_AFIO_AF(GPIOA_PIN7, 5U))
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
PIN_AFIO_AF(GPIOA_VBUS_FS, 0U) | \
PIN_AFIO_AF(GPIOA_PIN10, EFI_USB_AF) | \
PIN_AFIO_AF(GPIOA_PIN11, EFI_USB_AF) | \
PIN_AFIO_AF(GPIOA_PIN12, EFI_USB_AF) | \
PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
PIN_AFIO_AF(GPIOA_PIN11, 0U) | \
PIN_AFIO_AF(GPIOA_PIN12, 0U) | \
PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
PIN_AFIO_AF(GPIOA_PIN15, 0U))

View File

@ -41,15 +41,9 @@ void usb_serial_start(void) {
usbConnectBus(serusbcfg.usbp);
#if HAL_USE_SERIAL
/**
* todo: start taking USB pins from configuration?
* at the moment USB pinout is hard-coded in board.h file
*
* PA10/PA11/PA12
* #define GPIOA_OTG_FS_ID 10
* #define GPIOA_OTG_FS_DM 11
* #define GPIOA_OTG_FS_DP 12
*/
efiSetPadMode("USB ID", EFI_USB_SERIAL_ID, PAL_MODE_ALTERNATE(EFI_USB_AF));
efiSetPadMode("USB ID", EFI_USB_SERIAL_DM, PAL_MODE_ALTERNATE(EFI_USB_AF));
efiSetPadMode("USB ID", EFI_USB_SERIAL_DP, PAL_MODE_ALTERNATE(EFI_USB_AF));
/*
* Activates the serial driver 2 using the driver default configuration.
*/