]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Set DFU bootloader name
authorRowan Decker <Smasher816@gmail.com>
Sun, 8 Mar 2015 23:59:34 +0000 (16:59 -0700)
committerRowan Decker <Smasher816@gmail.com>
Mon, 9 Mar 2015 00:23:48 +0000 (17:23 -0700)
Fixes #22

Each (dfu) interface may have more than one a ltsetting each with their own index and name. According to the DFU_1.1 pdf section 4.2.3, "* Alternate settings can be used by an application to access additional memory segments. In this case,
it is suggested that each alternate setting employ a string descriptor to indicate the target memory
segment; e.g., 'EEPROM'." Whether or not we end up using multiple memory segments it is still good to have a descriptive name incase there are other dfu devices connected.

Edit: Fixed previous indentation

Bootloader/_buildvars.h
Bootloader/dfu.desc.c
Lib/CMake/arm.cmake

index 17a3557e30c51ad751c8ee2c00ba2e9d6d096c96..08d1a7e0ab395f7aeb9db18bbfc16999b3d2abc9 100644 (file)
@@ -32,6 +32,7 @@
 #define STR_MANUFACTURER       u"Kiibohd"
 #define STR_PRODUCT            u"Kiibohd DFU Bootloader"
 #define STR_SERIAL              u"@CHIP@"
+#define STR_ALTNAME              u"@BOOT_DFU_ALTNAME@"
 
 
 // Mac OS-X and Linux automatically load the correct drivers.  On
index 5d7d69cdf65858321cab2e17f2d435f8274c4aed..52377ea5dfc504aa9175cd2f981f451261fffb45 100644 (file)
@@ -50,7 +50,7 @@ static const struct usb_config_1 usb_config_1 = {
                        .bInterfaceClass = USB_DEV_CLASS_APP,
                        .bInterfaceSubClass = USB_DEV_SUBCLASS_APP_DFU,
                        .bInterfaceProtocol = USB_DEV_PROTO_DFU_DFU,
-                       .iInterface = 0
+                       .iInterface = 4
                },
 
        .dfu = {
@@ -101,6 +101,7 @@ static const struct usb_desc_string_t * const dfu_device_str_desc[] = {
        USB_DESC_STRING(STR_MANUFACTURER),
        USB_DESC_STRING(STR_PRODUCT),
        USB_DESC_STRING(STR_SERIAL),
+       USB_DESC_STRING(STR_ALTNAME),
        NULL
 };
 
index b468ae28e431f3cb34cec43a0c25b52b0dbbead7..3efbe7c0169955ae1ec45bd9b08881e300def093 100644 (file)
@@ -113,6 +113,7 @@ if ( "${CHIP}" MATCHES "mk20dx128vlf5" OR "${CHIP}" MATCHES "mk20dx256vlh7" )
        set( PRODUCT_ID      "0xB04D" )
        set( BOOT_VENDOR_ID  "0x1C11" )
        set( BOOT_PRODUCT_ID "0xB007" )
+       set( BOOT_DFU_ALTNAME "Kiibohd DFU" )
        set( DFU 1 )
        message( "dfu" )
 elseif ( "${CHIP}" MATCHES "mk20dx128" OR "${CHIP}" MATCHES "mk20dx256" )