diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-03-19 15:01:57 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-03-19 15:01:57 +0000 |
commit | 7184153e5dc68e134d64cb16a1096ba9f1957964 (patch) | |
tree | fd041d57355f95756b0e297f2cac30c6b46821d8 /Demos/Mouse/Mouse.c | |
parent | 3ab07f0d93b5265b486711952c8a2eb8f464a4a6 (diff) | |
download | lufa-7184153e5dc68e134d64cb16a1096ba9f1957964.tar.gz lufa-7184153e5dc68e134d64cb16a1096ba9f1957964.tar.bz2 lufa-7184153e5dc68e134d64cb16a1096ba9f1957964.zip |
Corrections to Keyboard and Mouse combined demos so that all modes (normal, interrupt, fully interrupt) work correctly.
Diffstat (limited to 'Demos/Mouse/Mouse.c')
-rw-r--r-- | Demos/Mouse/Mouse.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/Demos/Mouse/Mouse.c b/Demos/Mouse/Mouse.c index b61850abe..c4b7f55ad 100644 --- a/Demos/Mouse/Mouse.c +++ b/Demos/Mouse/Mouse.c @@ -113,9 +113,11 @@ int main(void) */
EVENT_HANDLER(USB_Connect)
{
+ #if !defined(INTERRUPT_CONTROL_ENDPOINT)
/* Start USB management task */
Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
-
+ #endif
+
/* Indicate USB enumerating */
UpdateStatus(Status_USBEnumerating);
@@ -307,15 +309,10 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) /** Fills the given HID report data structure with the next HID report to send to the host.
*
* \param ReportData Pointer to a HID report data structure to be filled
- *
- * \return Boolean true if the new report differs from the last report, false otherwise
*/
-bool CreateMouseReport(USB_MouseReport_Data_t* ReportData)
+void CreateMouseReport(USB_MouseReport_Data_t* ReportData)
{
- static uint8_t PrevJoyStatus = 0;
- static bool PrevHWBStatus = false;
- uint8_t JoyStatus_LCL = Joystick_GetStatus();
- bool InputChanged = false;
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
/* Clear the report contents */
memset(ReportData, 0, sizeof(USB_MouseReport_Data_t));
@@ -335,16 +332,6 @@ bool CreateMouseReport(USB_MouseReport_Data_t* ReportData) if (HWB_GetStatus())
ReportData->Button |= (1 << 1);
-
- /* Check if the new report is different to the previous report */
- InputChanged = ((uint8_t)(PrevJoyStatus ^ JoyStatus_LCL) | (uint8_t)(HWB_GetStatus() ^ PrevHWBStatus));
-
- /* Save the current joystick and HWB status for later comparison */
- PrevJoyStatus = JoyStatus_LCL;
- PrevHWBStatus = HWB_GetStatus();
-
- /* Return whether the new report is different to the previous report or not */
- return InputChanged;
}
/** Sends the next HID report to the host, via the keyboard data endpoint. */
|