Skip to content

Commit 7b18ee3

Browse files
committed
Require USB classes to implement descriptor
Make the function configuration_desc pure virtual inside USBDevice. This should be a compile time error since no subclass will work without a configuration descriptor.
1 parent 6ae9d41 commit 7b18ee3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

usb/device/USBDevice/USBDevice.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,7 @@ class USBDevice: public USBPhyEvents {
267267
* @param index descriptor index
268268
* @returns pointer to the configuration descriptor
269269
*/
270-
virtual const uint8_t *configuration_desc(uint8_t index)
271-
{
272-
return NULL;
273-
};
270+
virtual const uint8_t *configuration_desc(uint8_t index) = 0;
274271

275272
/*
276273
* Get string lang id descriptor

0 commit comments

Comments
 (0)