diff options
| author | hathach <[email protected]> | 2025-11-19 11:56:53 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-11-19 12:19:08 +0700 |
| commit | 1df116adfc70bb6d86f6046b46560d5c42762c28 (patch) | |
| tree | 8b7dac2e8c7aa09f62c4c6c080cf9c46a25a9e34 /src/class | |
| parent | fd3161087d76c84fb21e8e2f2d30a81d6b11bfba (diff) | |
clean up
Diffstat (limited to 'src/class')
| -rw-r--r-- | src/class/dfu/dfu_device.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/class/dfu/dfu_device.c b/src/class/dfu/dfu_device.c index 24b037ebb..ffe5941e8 100644 --- a/src/class/dfu/dfu_device.c +++ b/src/class/dfu/dfu_device.c @@ -251,6 +251,8 @@ bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, const tusb_control tud_control_status(rhport, request); } else if (stage == CONTROL_STAGE_ACK) { tud_dfu_detach_cb(); + } else { + // nothing to do } break; @@ -273,6 +275,8 @@ bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, const tusb_control tud_control_status(rhport, request); } else if (stage == CONTROL_STAGE_ACK) { tud_dfu_abort_cb(_dfu_ctx.alt); + } else { + // nothing to do } break; @@ -301,7 +305,7 @@ bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, const tusb_control _dfu_ctx.block = request->wValue; _dfu_ctx.length = request->wLength; - if (request->wLength) { + if (request->wLength > 0) { // Download with payload -> transition to DOWNLOAD SYNC _dfu_ctx.state = DFU_DNLOAD_SYNC; return tud_control_xfer(rhport, request, _transfer_buf, request->wLength); @@ -350,6 +354,8 @@ void tud_dfu_finish_flashing(uint8_t status) { _dfu_ctx.state = (_dfu_ctx.attrs & DFU_ATTR_MANIFESTATION_TOLERANT) ? DFU_MANIFEST_SYNC : DFU_MANIFEST_WAIT_RESET; + } else { + // nothing to do } } else { // failed while flashing, move to dfuError @@ -380,6 +386,8 @@ static bool process_download_get_status(uint8_t rhport, uint8_t stage, const tus } else { _dfu_ctx.state = DFU_DNLOAD_IDLE; } + } else { + // nothing to do } return true; @@ -407,6 +415,8 @@ static bool process_manifest_get_status(uint8_t rhport, uint8_t stage, const tus } else { _dfu_ctx.state = DFU_IDLE; } + } else { + // nothing to do } return true; |
