summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorJeremiah McCarthy <[email protected]>2021-04-22 16:04:09 -0400
committerJeremiah McCarthy <[email protected]>2021-04-22 16:04:09 -0400
commit18e9d253e986670f77a0f15f687eec258011605f (patch)
tree97c84802b42b55a02b0c82848aae9ddb9a802351 /src/class
parent0936a76dc905a104f03cd1135fc22a8652ee8c7f (diff)
Remove usb reset callback
Diffstat (limited to 'src/class')
-rw-r--r--src/class/dfu/dfu_device.c39
-rw-r--r--src/class/dfu/dfu_device.h8
2 files changed, 17 insertions, 30 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;
}
}
diff --git a/src/class/dfu/dfu_device.h b/src/class/dfu/dfu_device.h
index 28a241b3a..e92935fd7 100644
--- a/src/class/dfu/dfu_device.h
+++ b/src/class/dfu/dfu_device.h
@@ -58,14 +58,6 @@ uint8_t tud_dfu_init_attrs_cb(void);
// to the status description string table.
TU_ATTR_WEAK uint8_t tud_dfu_get_status_desc_table_index_cb(void);
-// Invoked during a USB reset
-// Lets the app perform custom behavior on a USB reset.
-// If not defined, the default behavior remains the DFU specification of
-// Checking the firmware valid and changing to the error state or rebooting to runtime
-// Note: If used, the application must perform the reset logic for all states.
-// Changing the state to APP_IDLE will result in tud_dfu_reboot_to_rt_cb being called
-TU_ATTR_WEAK void tud_dfu_usb_reset_cb(uint8_t rhport, dfu_state_t *state);
-
// Invoked during a DFU_GETSTATUS request to set the timeout in ms to use
// before the subsequent DFU_GETSTATUS requests.
// The purpose of this value is to allow the device to tell the host