Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
2d5e863
Fixed race condition when multiple SETUP messages queued.
agprimatic Nov 16, 2015
6cca260
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
e33bcc8
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
0d8fa22
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
60daba6
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
ccd8c68
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
82a63cd
Added return code to HID_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
4311cd1
Added return code to HID_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
1345baa
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
1cf4f49
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
f66b80c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
6af643c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
c448945
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
c0aafaa
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
60ae0ae
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
9b8180e
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
6fbef15
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
61b8761
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
a9cdcff
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
ae1c6d3
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
35aecf2
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
22b91e8
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
faf1ccd
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b5fdad9
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
44dfe57
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
c9d03d1
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
cc65931
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
cb10239
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
3c67b08
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b6791ed
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
d773378
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
3c41f74
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
96ccfb6
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b85c8c5
Added return code to MS_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
f89b2d1
Added return code to MS_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
94bdce4
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
2fe4c5a
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
13bf6a3
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
c87ab9e
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
c0a4fce
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
e808275
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
046f4c4
Added return code to CDC_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
99d309f
Added return code to CDC_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
442ef9a
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
4965db4
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
021d21b
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
2a17eb9
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
8ab7b9a
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
01558b6
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
56c496b
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
684a782
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
144fc6e
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
dee3a42
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
93825a4
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
1cb0ae0
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
bc42646
Added return code to RNDIS_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
2fbf8f5
Added return code to RNDIS_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
3ca2c61
Adding return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
d3129db
Adding return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
02fdff0
Adding return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
1bed5ca
Adding return code to Audio_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
e5c2d4f
Adding return code to Audio_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
6f01c31
Adding return code to MIDI_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
6e92c32
Adding return code to PRNT_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
1f1292d
Adding return code to PRNT_Device_ProcessControlRequest()
agprimatic Nov 16, 2015
3afc996
Adding return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
a12b700
Adding return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
fc62f79
Adding return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b2c92e7
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
68d8439
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
87c9108
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
2316480
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
8890ffa
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
ebc1344
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
99bee51
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
aa6f8ec
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b82789a
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
d0ab06b
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b142ebb
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
0dbca1c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b234071
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b97753f
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
314b72b
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
394a78c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
7bbf94c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
746c03e
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
1a4027b
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
be0724c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
2ac84fb
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
e570bc0
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
82af387
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
2fa0fc0
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
3920be9
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
e9fcdb0
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
d1deb70
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
b336e7d
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
23fc807
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
aba5eac
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
7aa7ea6
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
db82f9e
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
6e60882
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
cde305c
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
9f34f88
Added return code to EVENT_USB_Device_ControlRequest()
agprimatic Nov 16, 2015
8dfa920
Fixed race condition when multiple SETUP messages queued (2nd try).
agprimatic Nov 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Bootloaders/CDC/BootloaderCDC.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ void EVENT_USB_Device_ConfigurationChanged(void)
* the device from the USB host before passing along unhandled control requests to the library for processing
* internally.
*/
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
/* Ignore any requests that aren't directed to the CDC interface */
if ((USB_ControlRequest.bmRequestType & (CONTROL_REQTYPE_TYPE | CONTROL_REQTYPE_RECIPIENT)) !=
(REQTYPE_CLASS | REQREC_INTERFACE))
{
return;
return 0;
}

/* Activity - toggle indicator LEDs */
Expand All @@ -242,6 +242,7 @@ void EVENT_USB_Device_ControlRequest(void)
/* Write the line coding data to the control endpoint */
Endpoint_Write_Control_Stream_LE(&LineEncoding, sizeof(CDC_LineEncoding_t));
Endpoint_ClearOUT();
return 1;
}

break;
Expand All @@ -253,6 +254,7 @@ void EVENT_USB_Device_ControlRequest(void)
/* Read the line coding data in from the host into the global struct */
Endpoint_Read_Control_Stream_LE(&LineEncoding, sizeof(CDC_LineEncoding_t));
Endpoint_ClearIN();
return 1;
}

break;
Expand All @@ -261,10 +263,12 @@ void EVENT_USB_Device_ControlRequest(void)
{
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
return 1;
}

break;
}
return 0;
}

#if !defined(NO_BLOCK_SUPPORT)
Expand Down
19 changes: 13 additions & 6 deletions Bootloaders/DFU/BootloaderDFU.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ ISR(TIMER1_OVF_vect, ISR_BLOCK)
* the device from the USB host before passing along unhandled control requests to the library for processing
* internally.
*/
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
/* Ignore any requests that aren't directed to the DFU interface */
if ((USB_ControlRequest.bmRequestType & (CONTROL_REQTYPE_TYPE | CONTROL_REQTYPE_RECIPIENT)) !=
(REQTYPE_CLASS | REQREC_INTERFACE))
{
return;
return 0;
}

/* Activity - toggle indicator LEDs */
Expand Down Expand Up @@ -283,7 +283,7 @@ void EVENT_USB_Device_ControlRequest(void)
while (!(Endpoint_IsOUTReceived()))
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
return 0;
}

/* First byte of the data stage is the DNLOAD request's command */
Expand Down Expand Up @@ -415,6 +415,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearOUT();

Endpoint_ClearStatusStage();
return 1;

break;
case DFU_REQ_UPLOAD:
Expand All @@ -423,7 +424,7 @@ void EVENT_USB_Device_ControlRequest(void)
while (!(Endpoint_IsINReady()))
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
return 0;
}

if (DFU_State != dfuUPLOAD_IDLE)
Expand Down Expand Up @@ -515,14 +516,15 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearIN();

Endpoint_ClearStatusStage();
return 1;
break;
case DFU_REQ_GETSTATUS:
Endpoint_ClearSETUP();

while (!(Endpoint_IsINReady()))
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
return 0;
}

/* Write 8-bit status value */
Expand All @@ -541,6 +543,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearIN();

Endpoint_ClearStatusStage();
return 1;
break;
case DFU_REQ_CLRSTATUS:
Endpoint_ClearSETUP();
Expand All @@ -549,14 +552,15 @@ void EVENT_USB_Device_ControlRequest(void)
DFU_Status = OK;

Endpoint_ClearStatusStage();
return 1;
break;
case DFU_REQ_GETSTATE:
Endpoint_ClearSETUP();

while (!(Endpoint_IsINReady()))
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
return 0;
}

/* Write the current device state to the endpoint */
Expand All @@ -565,6 +569,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearIN();

Endpoint_ClearStatusStage();
return 1;
break;
case DFU_REQ_ABORT:
Endpoint_ClearSETUP();
Expand All @@ -573,8 +578,10 @@ void EVENT_USB_Device_ControlRequest(void)
DFU_State = dfuIDLE;

Endpoint_ClearStatusStage();
return 1;
break;
}
return 0;
}

/** Routine to discard the specified number of bytes from the control endpoint stream. This is used to
Expand Down
2 changes: 1 addition & 1 deletion Bootloaders/DFU/BootloaderDFU.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
static void SetupHardware(void);
static void ResetHardware(void);

void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);

#if defined(INCLUDE_FROM_BOOTLOADER_C)
static void DiscardFillerBytes(uint8_t NumberOfBytes);
Expand Down
7 changes: 5 additions & 2 deletions Bootloaders/HID/BootloaderHID.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ void EVENT_USB_Device_ConfigurationChanged(void)
* the device from the USB host before passing along unhandled control requests to the library for processing
* internally.
*/
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
/* Ignore any requests that aren't directed to the HID interface */
if ((USB_ControlRequest.bmRequestType & (CONTROL_REQTYPE_TYPE | CONTROL_REQTYPE_RECIPIENT)) !=
(REQTYPE_CLASS | REQREC_INTERFACE))
{
return;
return 0;
}

/* Process HID specific control requests */
Expand Down Expand Up @@ -184,7 +184,10 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearOUT();

Endpoint_ClearStatusStage();
return 1;
break;
}

return 0;
}

4 changes: 2 additions & 2 deletions Bootloaders/MassStorage/BootloaderMassStorage.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
MS_Device_ProcessControlRequest(&Disk_MS_Interface);
return MS_Device_ProcessControlRequest(&Disk_MS_Interface);
}

/** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.
Expand Down
2 changes: 1 addition & 1 deletion Bootloaders/MassStorage/BootloaderMassStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
void EVENT_USB_Device_Connect(void) AUX_BOOT_SECTION;
void EVENT_USB_Device_Disconnect(void) AUX_BOOT_SECTION;
void EVENT_USB_Device_ConfigurationChanged(void) AUX_BOOT_SECTION;
void EVENT_USB_Device_ControlRequest(void) AUX_BOOT_SECTION;
int EVENT_USB_Device_ControlRequest(void) AUX_BOOT_SECTION;

bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) AUX_BOOT_SECTION;

Expand Down
4 changes: 2 additions & 2 deletions Bootloaders/Printer/BootloaderPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
* the device from the USB host before passing along unhandled control requests to the library for processing
* internally.
*/
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
PRNT_Device_ProcessControlRequest(&TextOnly_Printer_Interface);
return PRNT_Device_ProcessControlRequest(&TextOnly_Printer_Interface);
}
2 changes: 1 addition & 1 deletion Bootloaders/Printer/BootloaderPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);

#endif

4 changes: 2 additions & 2 deletions Demos/Device/ClassDriver/AudioInput/AudioInput.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface);
return Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface);
}

/** Audio class driver callback for the setting and retrieval of streaming endpoint properties. This callback must be implemented
Expand Down
2 changes: 1 addition & 1 deletion Demos/Device/ClassDriver/AudioInput/AudioInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);

bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
const uint8_t EndpointProperty,
Expand Down
4 changes: 2 additions & 2 deletions Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface);
return Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface);
}

/** Audio class driver callback for the setting and retrieval of streaming endpoint properties. This callback must be implemented
Expand Down
4 changes: 2 additions & 2 deletions Demos/Device/ClassDriver/DualMIDI/DualMIDI.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);
return MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);
}

2 changes: 1 addition & 1 deletion Demos/Device/ClassDriver/DualMIDI/DualMIDI.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);

#endif

12 changes: 9 additions & 3 deletions Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,16 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface);
CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface);
int request_handled;

request_handled = CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface);
if (!request_handled) {
request_handled = CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface);
}

return request_handled;
}

/** CDC class driver callback function the processing of changes to the virtual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);

#endif

4 changes: 2 additions & 2 deletions Demos/Device/ClassDriver/GenericHID/GenericHID.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
HID_Device_ProcessControlRequest(&Generic_HID_Interface);
return HID_Device_ProcessControlRequest(&Generic_HID_Interface);
}

/** Event handler for the USB device Start Of Frame event. */
Expand Down
2 changes: 1 addition & 1 deletion Demos/Device/ClassDriver/GenericHID/GenericHID.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void);

bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
Expand Down
4 changes: 2 additions & 2 deletions Demos/Device/ClassDriver/Joystick/Joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
HID_Device_ProcessControlRequest(&Joystick_HID_Interface);
return HID_Device_ProcessControlRequest(&Joystick_HID_Interface);
}

/** Event handler for the USB device Start Of Frame event. */
Expand Down
2 changes: 1 addition & 1 deletion Demos/Device/ClassDriver/Joystick/Joystick.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void);

bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
Expand Down
4 changes: 2 additions & 2 deletions Demos/Device/ClassDriver/Keyboard/Keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
return HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
}

/** Event handler for the USB device Start Of Frame event. */
Expand Down
2 changes: 1 addition & 1 deletion Demos/Device/ClassDriver/Keyboard/Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void);

bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
Expand Down
12 changes: 9 additions & 3 deletions Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,16 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}

/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
int EVENT_USB_Device_ControlRequest(void)
{
HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
int request_handled;

request_handled = HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);
if (!request_handled) {
request_handled = HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
}

return request_handled;
}

/** Event handler for the USB device Start Of Frame event. */
Expand Down
2 changes: 1 addition & 1 deletion Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
int EVENT_USB_Device_ControlRequest(void);
void EVENT_USB_Device_StartOfFrame(void);

bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
Expand Down
Loading