diff --git a/Descriptors.c b/Descriptors.c index 725dbc3..bf84cc4 100644 --- a/Descriptors.c +++ b/Descriptors.c @@ -233,7 +233,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x18 } }; diff --git a/Keyboard.c b/Keyboard.c index 65c3dad..d1e5517 100755 --- a/Keyboard.c +++ b/Keyboard.c @@ -171,20 +171,7 @@ void __attribute__((noreturn)) Keyboard_Main(void) vm_step_all(); } - /* Limit frequency of mouse reports. Unlike keyboard reports, - identical reports won't be ignored by the class driver, so - report speed affects mouse movement speed. */ - uint8_t mouse_slice = (uptimems() & 0x8); - uint8_t perform_mouse_update = 0; - if(!mouse_slice && update.mouse){ - perform_mouse_update = 1; - update.mouse = 0; - } - else if(!update.mouse && mouse_slice){ - update.mouse = 1; - } - - USB_Perform_Update(1, perform_mouse_update); + USB_Perform_Update(); } } diff --git a/lufa/lufa_main.c b/lufa/lufa_main.c index 5a39c9d..ea5d206 100644 --- a/lufa/lufa_main.c +++ b/lufa/lufa_main.c @@ -111,12 +111,10 @@ void USB_KeepAlive(uint8_t poll){ } } -void USB_Perform_Update(uint8_t update_kbd, uint8_t update_mouse){ - if(update_mouse) - HID_Device_USBTask(&Mouse_HID_Interface); +void USB_Perform_Update(void){ + HID_Device_USBTask(&Mouse_HID_Interface); - if(update_kbd) - HID_Device_USBTask(&Keyboard_HID_Interface); + HID_Device_USBTask(&Keyboard_HID_Interface); USB_KeepAlive(true); } diff --git a/usb.h b/usb.h index 5c6130e..f1c136d 100644 --- a/usb.h +++ b/usb.h @@ -23,6 +23,6 @@ void USB_KeepAlive(uint8_t poll); * Performs a USB update, scanning keyboard/mouse and responding * to interrupt requests. Includes KeepAlive. */ -void USB_Perform_Update(uint8_t update_kbd, uint8_t update_mouse); +void USB_Perform_Update(void); #endif // __USB_H diff --git a/vusb/vusb_main.c b/vusb/vusb_main.c index 9837675..d66d1e3 100644 --- a/vusb/vusb_main.c +++ b/vusb/vusb_main.c @@ -405,14 +405,14 @@ void USB_KeepAlive(uint8_t poll){ } } -void USB_Perform_Update(uint8_t update_kbd, uint8_t update_mouse){ +void USB_Perform_Update(void){ USB_KeepAlive(true); static bool sending_keyboard = 0; static bool sending_mouse = 0; // Keyboard - if(!sending_keyboard && update_kbd){ + if(!sending_keyboard){ // Update, set sending_keyboard if the report is different to last time sending_keyboard = update_and_compare(&KeyboardReportData, &PrevKeyboardHIDReportBuffer, sizeof(KeyboardReport_Data_t), (void(*)(void*)) &Fill_KeyboardReport); } @@ -430,7 +430,7 @@ void USB_Perform_Update(uint8_t update_kbd, uint8_t update_mouse){ } // Mouse - if(!sending_mouse && update_mouse){ + if(!sending_mouse){ // Update, set sending_mouse if the report is different to last time sending_mouse = update_and_compare(&MouseReportData, &PrevMouseHIDReportBuffer, sizeof(MouseReport_Data_t), (void(*)(void*)) &Fill_MouseReport); // Mouse reports need to repeat for the cursor to continue to move, so always send if there is a movement component to the report