mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Merge branch 'master' of https://github.com/xmos-jmccarthy/tinyusb into xmos-jmccarthy-master
This commit is contained in:
commit
227dd2d40a
@ -249,6 +249,7 @@ static uint16_t dfu_req_upload(uint8_t rhport, tusb_control_request_t const * re
|
|||||||
{
|
{
|
||||||
TU_VERIFY( wLength <= CFG_TUD_DFU_TRANSFER_BUFFER_SIZE);
|
TU_VERIFY( wLength <= CFG_TUD_DFU_TRANSFER_BUFFER_SIZE);
|
||||||
uint16_t retval = tud_dfu_req_upload_data_cb(block_num, (uint8_t *)_dfu_state_ctx.transfer_buf, wLength);
|
uint16_t retval = tud_dfu_req_upload_data_cb(block_num, (uint8_t *)_dfu_state_ctx.transfer_buf, wLength);
|
||||||
|
TU_ASSERT( retval <= CFG_TUD_DFU_TRANSFER_BUFFER_SIZE);
|
||||||
tud_control_xfer(rhport, request, _dfu_state_ctx.transfer_buf, retval);
|
tud_control_xfer(rhport, request, _dfu_state_ctx.transfer_buf, retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -276,6 +277,7 @@ static void dfu_req_dnload_setup(uint8_t rhport, tusb_control_request_t const *
|
|||||||
// if they wish, there still will be the internal control buffer copy to this buffer
|
// if they wish, there still will be the internal control buffer copy to this buffer
|
||||||
// but this mode would provide zero copy from the class driver to the application
|
// but this mode would provide zero copy from the class driver to the application
|
||||||
|
|
||||||
|
TU_VERIFY( request->wLength <= CFG_TUD_DFU_TRANSFER_BUFFER_SIZE);
|
||||||
// setup for data phase
|
// setup for data phase
|
||||||
tud_control_xfer(rhport, request, _dfu_state_ctx.transfer_buf, request->wLength);
|
tud_control_xfer(rhport, request, _dfu_state_ctx.transfer_buf, request->wLength);
|
||||||
}
|
}
|
||||||
@ -283,6 +285,7 @@ static void dfu_req_dnload_setup(uint8_t rhport, tusb_control_request_t const *
|
|||||||
static void dfu_req_dnload_reply(uint8_t rhport, tusb_control_request_t const * request)
|
static void dfu_req_dnload_reply(uint8_t rhport, tusb_control_request_t const * request)
|
||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
|
TU_VERIFY( request->wLength <= CFG_TUD_DFU_TRANSFER_BUFFER_SIZE);
|
||||||
tud_dfu_req_dnload_data_cb(request->wValue, (uint8_t *)_dfu_state_ctx.transfer_buf, request->wLength);
|
tud_dfu_req_dnload_data_cb(request->wValue, (uint8_t *)_dfu_state_ctx.transfer_buf, request->wLength);
|
||||||
_dfu_state_ctx.blk_transfer_in_proc = false;
|
_dfu_state_ctx.blk_transfer_in_proc = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user