Fixed slave-side keyboard half unresponsiveness (#9360)

* Fixed slave-side keyboard half unresponsiveness
due to how LUFA handles USB_Disable()

* changes to formatting

Co-authored-by: Joel Challis <git@zvecr.com>

Co-authored-by: Joel Challis <git@zvecr.com>
master
Adrian 2020-06-10 18:25:45 +02:00 committed by GitHub
parent b7cb4111ea
commit cff3c3bf28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ volatile bool isLeftHand = true;
#if defined(SPLIT_USB_DETECT)
# if defined(PROTOCOL_LUFA)
static inline bool usbHasActiveConnection(void) { return USB_Device_IsAddressSet(); }
static inline void usbDisable(void) { USB_Disable(); }
static inline void usbDisable(void) {
USB_Disable();
USB_DeviceState = DEVICE_STATE_Unattached;
}
# elif defined(PROTOCOL_CHIBIOS)
static inline bool usbHasActiveConnection(void) { return usbGetDriverStateI(&USBD1) == USB_ACTIVE; }
static inline void usbDisable(void) { usbStop(&USBD1); }