DFU: Set 10ms bwPollTimeout (lowest possible as per spec)

This commit is contained in:
Harald Welte
2017-03-03 01:13:34 +01:00
parent 91fc40240e
commit ac4f66e5d1
2 changed files with 4 additions and 2 deletions

View File

@@ -64,6 +64,7 @@ static __dfufunc void handle_getstatus(void)
{
/* has to be static as USBD_Write is async ? */
static struct dfu_status dstat;
static const uint8_t poll_timeout_10ms[] = { 10, 0, 0 };
dfu_drv_updstatus();
@@ -71,7 +72,7 @@ static __dfufunc void handle_getstatus(void)
dstat.bStatus = g_dfu->status;
dstat.bState = g_dfu->state;
dstat.iString = 0;
/* FIXME: set dstat.bwPollTimeout */
memcpy(&dstat.bwPollTimeout, poll_timeout_10ms, sizeof(dstat.bwPollTimeout));
TRACE_DEBUG("handle_getstatus(%u, %u)\n\r", dstat.bStatus, dstat.bState);

View File

@@ -45,12 +45,13 @@ static __dfufunc void handle_getstatus(void)
{
/* has to be static as USBD_Write is async ? */
static struct dfu_status dstat;
static const uint8_t poll_timeout_10ms[] = { 10, 0, 0 };
/* send status response */
dstat.bStatus = g_dfu->status;
dstat.bState = g_dfu->state;
dstat.iString = 0;
/* FIXME: set dstat.bwPollTimeout */
memcpy(&dstat.bwPollTimeout, poll_timeout_10ms, sizeof(dstat.bwPollTimeout));
TRACE_DEBUG("handle_getstatus(%u, %u)\n\r", dstat.bStatus, dstat.bState);