X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d753512ccae76a4fce665b2c16ba7d5867143a96..7ef58eef7a57c46ab53ed8a26805b58dcffd7010:/Demos/Device/LowLevel/Mouse/Mouse.c?ds=inline diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 4b318e30c..ff54c6544 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -268,9 +268,6 @@ void SendNextReport(void) if ((MouseReportData.Y != 0) || (MouseReportData.X != 0)) SendReport = true; - /* Save the current report data for later comparison to check for changes */ - PrevMouseReportData = MouseReportData; - /* Check if the idle period is set and has elapsed */ if ((IdleCount != HID_IDLE_CHANGESONLY) && (!(IdleMSRemaining))) { @@ -286,7 +283,10 @@ void SendNextReport(void) /* Check if Mouse Endpoint Ready for Read/Write and if we should send a new report */ if (Endpoint_IsReadWriteAllowed() && SendReport) - { + { + /* Save the current report data for later comparison to check for changes */ + PrevMouseReportData = MouseReportData; + /* Write Mouse Report Data */ Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));