use class driver open() for interface support detection

tested with dfu_runtime
This commit is contained in:
hathach
2020-04-15 00:59:56 +07:00
parent ae60146274
commit 3ef6e33533
5 changed files with 38 additions and 81 deletions

View File

@@ -61,8 +61,8 @@ bool dfu_rtd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16
(void) rhport;
// Ensure this is DFU Runtime
TU_ASSERT(itf_desc->bInterfaceSubClass == TUD_DFU_APP_SUBCLASS);
TU_ASSERT(itf_desc->bInterfaceProtocol == DFU_PROTOCOL_RT);
TU_VERIFY(itf_desc->bInterfaceSubClass == TUD_DFU_APP_SUBCLASS);
TU_VERIFY(itf_desc->bInterfaceProtocol == DFU_PROTOCOL_RT);
uint8_t const * p_desc = tu_desc_next( itf_desc );
(*p_length) = sizeof(tusb_desc_interface_t);

View File

@@ -58,7 +58,7 @@ typedef enum
//--------------------------------------------------------------------+
// Invoked when received new data
TU_ATTR_WEAK void tud_dfu_rt_reboot_to_dfu(void);
TU_ATTR_WEAK void tud_dfu_rt_reboot_to_dfu(void); // TODO rename to _cb convention
//--------------------------------------------------------------------+
// Internal Class Driver API