diff options
| author | MasterPhi <[email protected]> | 2021-07-27 18:08:52 +0200 |
|---|---|---|
| committer | MasterPhi <[email protected]> | 2021-07-27 18:08:52 +0200 |
| commit | 0ba4315ae559f595c0d01ab650ea924d8e9bec69 (patch) | |
| tree | f0ceeb48cfd683b1bbbde5a51e23d653197d89b5 | |
| parent | b6b5a33806527ed06b57930067eb4a386839d274 (diff) | |
Fix IAR warning
| -rw-r--r-- | src/class/dfu/dfu_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/class/dfu/dfu_device.c b/src/class/dfu/dfu_device.c index ad87092e0..28abf6e83 100644 --- a/src/class/dfu/dfu_device.c +++ b/src/class/dfu/dfu_device.c @@ -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; // 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); return drv_len; @@ -365,7 +365,7 @@ void tud_dfu_finish_flashing(uint8_t status) { // failed while flashing, move to dfuError _dfu_ctx.state = DFU_ERROR; - _dfu_ctx.status = status; + _dfu_ctx.status = (dfu_status_t)status; } } |
