Merge pull request #5676 from conkerkh/CMS_FIX

Disable CMS when USB is connected on CDC_HID enabled targets.
This commit is contained in:
Michael Keller 2018-05-01 11:07:56 +12:00 committed by GitHub
commit fba59c32b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -68,6 +68,11 @@
#include "rx/rx.h"
#ifdef USE_USB_CDC_HID
#include "sensors/battery.h"
#include "pg/usb.h"
#endif
// DisplayPort management
#ifndef CMS_MAX_DEVICE
@ -993,6 +998,11 @@ void cmsUpdate(uint32_t currentTimeUs)
return ;
}
#endif
#ifdef USE_USB_CDC_HID
if (getBatteryCellCount() == 0 && usbDevConfig()->type == COMPOSITE) {
return;
}
#endif
static int16_t rcDelayMs = BUTTON_TIME;
static int holdCount = 1;