mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-05-03 22:09:10 +00:00
Removed new Start of Frame event from the library; performance suffered far too much and it was only useful in one of the standard classes (HID). Altered HID demos to use the previous method of tracking millisecond periods via a hardware timer rather than the SOF events.
Fixed MIDI class driver blocking on unread events to the host.
This commit is contained in:
@@ -37,7 +37,7 @@ USB_ClassInfo_HID_t Mouse_HID_Interface =
|
||||
.ReportINEndpointNumber = MOUSE_EPNUM,
|
||||
.ReportINEndpointSize = MOUSE_EPSIZE,
|
||||
|
||||
.ReportBufferSize = sizeof(USB_MouseReport_Data_t),
|
||||
.ReportINBufferSize = sizeof(USB_MouseReport_Data_t),
|
||||
};
|
||||
|
||||
int main(void)
|
||||
@@ -67,6 +67,12 @@ void SetupHardware(void)
|
||||
LEDs_Init();
|
||||
Buttons_Init();
|
||||
USB_Init();
|
||||
|
||||
/* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
|
||||
OCR0A = ((F_CPU / 64) / 1000);
|
||||
TCCR0A = (1 << WGM01);
|
||||
TCCR0B = ((1 << CS01) | (1 << CS00));
|
||||
TIMSK0 = (1 << OCIE0A);
|
||||
}
|
||||
|
||||
void EVENT_USB_Connect(void)
|
||||
@@ -92,9 +98,10 @@ void EVENT_USB_UnhandledControlPacket(void)
|
||||
USB_HID_ProcessControlPacket(&Mouse_HID_Interface);
|
||||
}
|
||||
|
||||
void EVENT_USB_StartOfFrame(void)
|
||||
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
|
||||
{
|
||||
USB_HID_RegisterStartOfFrame(&Mouse_HID_Interface);
|
||||
if (Mouse_HID_Interface.IdleMSRemaining)
|
||||
Mouse_HID_Interface.IdleMSRemaining--;
|
||||
}
|
||||
|
||||
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
void EVENT_USB_Disconnect(void);
|
||||
void EVENT_USB_ConfigurationChanged(void);
|
||||
void EVENT_USB_UnhandledControlPacket(void);
|
||||
void EVENT_USB_StartOfFrame(void);
|
||||
|
||||
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);
|
||||
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,
|
||||
|
||||
Reference in New Issue
Block a user