mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Adding ability to configure USB positive data pin (PA12 is STM specific) (#14141)
This commit is contained in:
parent
8375e4e002
commit
07e4b4f1ad
4 changed files with 13 additions and 7 deletions
|
@ -67,14 +67,17 @@ bool usbCableIsInserted(void)
|
|||
|
||||
void usbGenerateDisconnectPulse(void)
|
||||
{
|
||||
/* Pull down PA12 to create USB disconnect pulse */
|
||||
IO_t usbPin = IOGetByTag(IO_TAG(PA12));
|
||||
#ifdef USB_DP_PIN
|
||||
/* Pull down USB_DP_PIN to create USB disconnect pulse */
|
||||
IO_t usbPin = IOGetByTag(IO_TAG(USB_DP_PIN));
|
||||
if (!usbPin) {
|
||||
return;
|
||||
}
|
||||
|
||||
IOConfigGPIO(usbPin, IOCFG_OUT_OD);
|
||||
|
||||
IOLo(usbPin);
|
||||
|
||||
delay(200);
|
||||
|
||||
IOHi(usbPin);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -200,8 +200,7 @@
|
|||
|
||||
#define DMA_TRAIT_CHANNEL 1
|
||||
|
||||
#endif
|
||||
#define USB_DP_PIN PA12
|
||||
|
||||
#if defined(APM32F4)
|
||||
#define FLASH_CONFIG_BUFFER_TYPE uint32_t
|
||||
#endif
|
||||
|
|
|
@ -158,3 +158,5 @@ typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
|
|||
#endif
|
||||
|
||||
#define FLASH_CONFIG_BUFFER_TYPE uint32_t
|
||||
|
||||
#define USB_DP_PIN PA12
|
||||
|
|
|
@ -416,3 +416,5 @@ extern uint8_t _dmaram_end__;
|
|||
#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7) || defined(STM32G4)
|
||||
#define DMA_TRAIT_CHANNEL 1
|
||||
#endif
|
||||
|
||||
#define USB_DP_PIN PA12
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue