From 3d605b672a0ba55eca24faeb24dc73ab59812d72 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Thu, 10 May 2018 22:39:39 -0500 Subject: [PATCH] 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. --- usb/device/USBDevice/USBDevice.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usb/device/USBDevice/USBDevice.h b/usb/device/USBDevice/USBDevice.h index a1b491574b..40051ce9c0 100644 --- a/usb/device/USBDevice/USBDevice.h +++ b/usb/device/USBDevice/USBDevice.h @@ -267,10 +267,7 @@ public: * @param index descriptor index * @returns pointer to the configuration descriptor */ - virtual const uint8_t *configuration_desc(uint8_t index) - { - return NULL; - }; + virtual const uint8_t *configuration_desc(uint8_t index) = 0; /* * Get string lang id descriptor