summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorJeremiah McCarthy <[email protected]>2021-05-06 12:18:55 -0400
committerJeremiah McCarthy <[email protected]>2021-05-06 12:18:55 -0400
commit05892a5a1ee9c50cb966b2e8ec8243ef97f794e2 (patch)
tree3ad797edb1913625b824c1524e55be24dcd74e70 /src/device/usbd.h
parentee00918b7c0f88bdf4fb7f9f48765c2ee7758891 (diff)
parentb51e0eb860b541ff27fb93b39263748b12bb1315 (diff)
Merge branch 'master' of github.com:xmos-jmccarthy/tinyusb
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 7c50a6db0..9e94d8d90 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -1,4 +1,4 @@
-/*
+/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
@@ -583,7 +583,7 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
//------------- DFU Runtime -------------//
#define TUD_DFU_APP_CLASS (TUSB_CLASS_APPLICATION_SPECIFIC)
-#define TUD_DFU_APP_SUBCLASS 0x01u
+#define TUD_DFU_APP_SUBCLASS (APP_SUBCLASS_DFU_RUNTIME)
// Length of template descriptr: 18 bytes
#define TUD_DFU_RT_DESC_LEN (9 + 9)
@@ -596,6 +596,17 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
/* Function */ \
9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0101)
+// Length of template descriptr: 18 bytes
+#define TUD_DFU_MODE_DESC_LEN (9 + 9)
+
+// DFU runtime descriptor
+// Interface number, string index, attributes, detach timeout, transfer size
+#define TUD_DFU_MODE_DESCRIPTOR(_itfnum, _stridx, _attr, _timeout, _xfer_size) \
+ /* Interface */ \
+ 9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUD_DFU_APP_CLASS, TUD_DFU_APP_SUBCLASS, DFU_PROTOCOL_DFU, _stridx, \
+ /* Function */ \
+ 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0101)
+
//------------- CDC-ECM -------------//