aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGareth McMullin2012-01-19 21:51:42 +1300
committerGareth McMullin2012-01-19 21:51:42 +1300
commitf5d8bda6e6bdca235126f2766739bd2ad25af11a (patch)
tree8784aa4739e517506518f73a6a45574ccb19901d /src
parentf2f5fd2fa13f74560bb2cfd88417ad6c1e230988 (diff)
Support DFU GET_STATUS request when in application mode.
Diffstat (limited to 'src')
-rw-r--r--src/stm32/cdcacm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stm32/cdcacm.c b/src/stm32/cdcacm.c
index 099b20e..0ecb553 100644
--- a/src/stm32/cdcacm.c
+++ b/src/stm32/cdcacm.c
@@ -434,6 +434,20 @@ static int cdcacm_control_request(struct usb_setup_data *req, uint8_t **buf,
return 1;
}
#endif
+ case DFU_GETSTATUS:
+ if(req->wIndex == DFU_IF_NO) {
+ u32 bwPollTimeout = 0; /* 24-bit integer in DFU class spec */
+
+ (*buf)[0] = DFU_STATUS_OK;
+ (*buf)[1] = 0;
+ (*buf)[2] = 0;
+ (*buf)[3] = 0;
+ (*buf)[4] = STATE_APP_IDLE;
+ (*buf)[5] = 0; /* iString not used here */
+ *len = 6;
+
+ return 1;
+ }
case DFU_DETACH:
if(req->wIndex == DFU_IF_NO) {
*complete = dfu_detach_complete;