diff options
| author | Jeremiah McCarthy <[email protected]> | 2021-04-22 16:04:09 -0400 |
|---|---|---|
| committer | Jeremiah McCarthy <[email protected]> | 2021-04-22 16:04:09 -0400 |
| commit | 18e9d253e986670f77a0f15f687eec258011605f (patch) | |
| tree | 97c84802b42b55a02b0c82848aae9ddb9a802351 /src/class/dfu/dfu_device.c | |
| parent | 0936a76dc905a104f03cd1135fc22a8652ee8c7f (diff) | |
Remove usb reset callback
Diffstat (limited to 'src/class/dfu/dfu_device.c')
| -rw-r--r-- | src/class/dfu/dfu_device.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/class/dfu/dfu_device.c b/src/class/dfu/dfu_device.c index 85e884d0d..085c2b455 100644 --- a/src/class/dfu/dfu_device.c +++ b/src/class/dfu/dfu_device.c @@ -160,32 +160,27 @@ void dfu_moded_reset(uint8_t rhport) { _dfu_state_ctx.state = DFU_IDLE; } else { - if ( tud_dfu_usb_reset_cb ) + switch (_dfu_state_ctx.state) { - tud_dfu_usb_reset_cb(rhport, &_dfu_state_ctx.state); - } else { - switch (_dfu_state_ctx.state) + case DFU_IDLE: + case DFU_DNLOAD_SYNC: + case DFU_DNBUSY: + case DFU_DNLOAD_IDLE: + case DFU_MANIFEST_SYNC: + case DFU_MANIFEST: + case DFU_MANIFEST_WAIT_RESET: + case DFU_UPLOAD_IDLE: { - case DFU_IDLE: - case DFU_DNLOAD_SYNC: - case DFU_DNBUSY: - case DFU_DNLOAD_IDLE: - case DFU_MANIFEST_SYNC: - case DFU_MANIFEST: - case DFU_MANIFEST_WAIT_RESET: - case DFU_UPLOAD_IDLE: - { - _dfu_state_ctx.state = (tud_dfu_firmware_valid_check_cb()) ? APP_IDLE : DFU_ERROR; - } - break; + _dfu_state_ctx.state = (tud_dfu_firmware_valid_check_cb()) ? APP_IDLE : DFU_ERROR; + } + break; - case DFU_ERROR: - default: - { - _dfu_state_ctx.state = APP_IDLE; - } - break; + case DFU_ERROR: + default: + { + _dfu_state_ctx.state = APP_IDLE; } + break; } } |
