mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-23 17:42:22 +00:00
commit
aca24ed481
@ -190,7 +190,7 @@ uint16_t dfu_moded_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc,
|
|||||||
_dfu_ctx.attrs = func_desc->bAttributes;
|
_dfu_ctx.attrs = func_desc->bAttributes;
|
||||||
|
|
||||||
// CFG_TUD_DFU_XFER_BUFSIZE has to be set to the buffer size used in TUD_DFU_DESCRIPTOR
|
// CFG_TUD_DFU_XFER_BUFSIZE has to be set to the buffer size used in TUD_DFU_DESCRIPTOR
|
||||||
uint16_t const transfer_size = tu_le16toh( tu_unaligned_read16(&func_desc->wTransferSize) );
|
uint16_t const transfer_size = tu_le16toh( tu_unaligned_read16((uint8_t*) func_desc + offsetof(tusb_desc_dfu_functional_t, wTransferSize)) );
|
||||||
TU_ASSERT(transfer_size <= CFG_TUD_DFU_XFER_BUFSIZE, drv_len);
|
TU_ASSERT(transfer_size <= CFG_TUD_DFU_XFER_BUFSIZE, drv_len);
|
||||||
|
|
||||||
return drv_len;
|
return drv_len;
|
||||||
@ -365,7 +365,7 @@ void tud_dfu_finish_flashing(uint8_t status)
|
|||||||
{
|
{
|
||||||
// failed while flashing, move to dfuError
|
// failed while flashing, move to dfuError
|
||||||
_dfu_ctx.state = DFU_ERROR;
|
_dfu_ctx.state = DFU_ERROR;
|
||||||
_dfu_ctx.status = status;
|
_dfu_ctx.status = (dfu_status_t)status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user