mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-10 21:44:24 +00:00
Add DFU_DETACH support
This commit is contained in:
parent
88478594bc
commit
3949fb9e8c
@ -263,6 +263,12 @@ bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_reque
|
|||||||
|
|
||||||
switch (request->bRequest)
|
switch (request->bRequest)
|
||||||
{
|
{
|
||||||
|
case DFU_REQUEST_DETACH:
|
||||||
|
{
|
||||||
|
tud_control_status(rhport, request);
|
||||||
|
if (tud_dfu_reboot_cb) tud_dfu_reboot_cb();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DFU_REQUEST_DNLOAD:
|
case DFU_REQUEST_DNLOAD:
|
||||||
{
|
{
|
||||||
if ( (stage == CONTROL_STAGE_ACK)
|
if ( (stage == CONTROL_STAGE_ACK)
|
||||||
@ -273,7 +279,6 @@ bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_reque
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} // fallthrough
|
} // fallthrough
|
||||||
case DFU_REQUEST_DETACH:
|
|
||||||
case DFU_REQUEST_UPLOAD:
|
case DFU_REQUEST_UPLOAD:
|
||||||
case DFU_REQUEST_GETSTATUS:
|
case DFU_REQUEST_GETSTATUS:
|
||||||
case DFU_REQUEST_CLRSTATUS:
|
case DFU_REQUEST_CLRSTATUS:
|
||||||
|
@ -81,6 +81,8 @@ TU_ATTR_WEAK void tud_dfu_abort_cb(void);
|
|||||||
// Return the number of bytes to write
|
// Return the number of bytes to write
|
||||||
TU_ATTR_WEAK uint16_t tud_dfu_req_upload_data_cb(uint8_t alt, uint16_t block_num, uint8_t* data, uint16_t length);
|
TU_ATTR_WEAK uint16_t tud_dfu_req_upload_data_cb(uint8_t alt, uint16_t block_num, uint8_t* data, uint16_t length);
|
||||||
|
|
||||||
|
// Invoked when a DFU_DETACH request is received
|
||||||
|
TU_ATTR_WEAK void tud_dfu_reboot_cb(void);
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Internal Class Driver API
|
// Internal Class Driver API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
Loading…
x
Reference in New Issue
Block a user