mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-24 17:28:32 +03:00
DFU: Set 10ms bwPollTimeout (lowest possible as per spec)
This commit is contained in:
@@ -64,6 +64,7 @@ static __dfufunc void handle_getstatus(void)
|
|||||||
{
|
{
|
||||||
/* has to be static as USBD_Write is async ? */
|
/* has to be static as USBD_Write is async ? */
|
||||||
static struct dfu_status dstat;
|
static struct dfu_status dstat;
|
||||||
|
static const uint8_t poll_timeout_10ms[] = { 10, 0, 0 };
|
||||||
|
|
||||||
dfu_drv_updstatus();
|
dfu_drv_updstatus();
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ static __dfufunc void handle_getstatus(void)
|
|||||||
dstat.bStatus = g_dfu->status;
|
dstat.bStatus = g_dfu->status;
|
||||||
dstat.bState = g_dfu->state;
|
dstat.bState = g_dfu->state;
|
||||||
dstat.iString = 0;
|
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);
|
TRACE_DEBUG("handle_getstatus(%u, %u)\n\r", dstat.bStatus, dstat.bState);
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,13 @@ static __dfufunc void handle_getstatus(void)
|
|||||||
{
|
{
|
||||||
/* has to be static as USBD_Write is async ? */
|
/* has to be static as USBD_Write is async ? */
|
||||||
static struct dfu_status dstat;
|
static struct dfu_status dstat;
|
||||||
|
static const uint8_t poll_timeout_10ms[] = { 10, 0, 0 };
|
||||||
|
|
||||||
/* send status response */
|
/* send status response */
|
||||||
dstat.bStatus = g_dfu->status;
|
dstat.bStatus = g_dfu->status;
|
||||||
dstat.bState = g_dfu->state;
|
dstat.bState = g_dfu->state;
|
||||||
dstat.iString = 0;
|
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);
|
TRACE_DEBUG("handle_getstatus(%u, %u)\n\r", dstat.bStatus, dstat.bState);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user