From 0de99cd069159afd433d950521ff0eba4e586d12 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 3 Mar 2017 01:20:19 +0100 Subject: [PATCH] DFU: String descriptors for DFU alt-interfaces they are only shown in DFU mode for now, until we find a way to export them over to the runtime. --- .../usb/device/dfu/dfu_desc.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c index 42974cc9..cfd26658 100644 --- a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c +++ b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c @@ -160,12 +160,38 @@ static const unsigned char configStringDescriptor[] = { USBStringDescriptor_UNICODE('U'), }; +static const unsigned char altRamStringDescriptor[] = { + USBStringDescriptor_LENGTH(3), + USBGenericDescriptor_STRING, + USBStringDescriptor_UNICODE('R'), + USBStringDescriptor_UNICODE('A'), + USBStringDescriptor_UNICODE('M'), +}; + +static const unsigned char altAppStringDescriptor[] = { + USBStringDescriptor_LENGTH(11), + USBGenericDescriptor_STRING, + USBStringDescriptor_UNICODE('F'), + USBStringDescriptor_UNICODE('l'), + USBStringDescriptor_UNICODE('a'), + USBStringDescriptor_UNICODE('s'), + USBStringDescriptor_UNICODE('h'), + USBStringDescriptor_UNICODE(' '), + USBStringDescriptor_UNICODE('('), + USBStringDescriptor_UNICODE('A'), + USBStringDescriptor_UNICODE('p'), + USBStringDescriptor_UNICODE('p'), + USBStringDescriptor_UNICODE(')'), +}; + /** List of string descriptors used by the device */ static const unsigned char *usb_strings[] = { langDesc, [STR_MANUF] = manufStringDescriptor, [STR_PROD] = productStringDescriptor, [STR_CONFIG] = configStringDescriptor, + [_STR_FIRST_ALT] = altRamStringDescriptor, + [_STR_FIRST_ALT+1] = altAppStringDescriptor, }; #endif