/* Sends the next HID report to the host, via the keyboard data endpoint.  */
void SendNextReport(void)
/* Sends the next HID report to the host, via the keyboard data endpoint.  */
void SendNextReport(void)
{
	static USB_MouseReport_Data_t PrevMouseReportData;
	USB_MouseReport_Data_t        MouseReportData;
	bool                          SendReport;
	CreateMouseReport(&MouseReportData);
	SendReport = (memcmp(&PrevMouseReportData, &MouseReportData, sizeof(USB_MouseReport_Data_t)) != 0);
	if ((MouseReportData.Y != 0) || (MouseReportData.X != 0))
	  SendReport = true;
	if (IdleCount && (!(IdleMSRemaining)))
	{
		IdleMSRemaining = IdleCount;
		SendReport = true;
	}
	Endpoint_SelectEndpoint(MOUSE_EPADDR);
	if (Endpoint_IsReadWriteAllowed() && SendReport)
	{
		PrevMouseReportData = MouseReportData;
		Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData), NULL);
		Endpoint_ClearIN();
	}
}