1
0
Fork 0
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:
Jay Blackman 2025-01-12 07:45:08 +11:00 committed by GitHub
parent 8375e4e002
commit 07e4b4f1ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -158,3 +158,5 @@ typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
#endif
#define FLASH_CONFIG_BUFFER_TYPE uint32_t
#define USB_DP_PIN PA12

View file

@ -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