1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Disable VBUSSENSING features on PA9 completely

This commit is contained in:
jflyper 2018-04-13 02:07:58 +09:00
parent 3cf1851382
commit 78bc3f52ad
2 changed files with 11 additions and 7 deletions

View file

@ -28,13 +28,13 @@
#include "sdcard.h"
#ifdef USB_DETECT_PIN
#ifdef USE_USB_DETECT
static IO_t usbDetectPin = IO_NONE;
#endif
void usbCableDetectDeinit(void)
{
#ifdef USB_DETECT_PIN
#ifdef USE_USB_DETECT
IOInit(usbDetectPin, OWNER_FREE, 0);
IOConfigGPIO(usbDetectPin, IOCFG_IN_FLOATING);
usbDetectPin = IO_NONE;
@ -43,7 +43,10 @@ void usbCableDetectDeinit(void)
void usbCableDetectInit(void)
{
#ifdef USB_DETECT_PIN
#ifdef USE_USB_DETECT
#ifndef USB_DETECT_PIN
#define USB_DETECT_PIN NONE
#endif
usbDetectPin = IOGetByTag(IO_TAG(USB_DETECT_PIN));
IOInit(usbDetectPin, OWNER_USB_DETECT, 0);
@ -55,7 +58,7 @@ bool usbCableIsInserted(void)
{
bool result = false;
#ifdef USB_DETECT_PIN
#ifdef USE_USB_DETECT
result = IORead(usbDetectPin) != 0;
#endif