diff options
Diffstat (limited to 'stm/stmusbd')
| -rw-r--r-- | stm/stmusbd/usbd_cdc_vcp.c | 4 | ||||
| -rw-r--r-- | stm/stmusbd/usbd_pyb_core.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/stm/stmusbd/usbd_cdc_vcp.c b/stm/stmusbd/usbd_cdc_vcp.c index fc2bbc458..6885f7cff 100644 --- a/stm/stmusbd/usbd_cdc_vcp.c +++ b/stm/stmusbd/usbd_cdc_vcp.c @@ -62,6 +62,8 @@ static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t* Buf, uint32_t Len); static uint16_t VCP_DataTx (const uint8_t* Buf, uint32_t Len);
static uint16_t VCP_DataRx (uint8_t* Buf, uint32_t Len);
+extern int dev_is_connected;
+
CDC_IF_Prop_TypeDef VCP_fops =
{
VCP_Init,
@@ -158,7 +160,7 @@ static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t* Buf, uint32_t Len) break;
case SET_CONTROL_LINE_STATE:
- /* Not needed for this driver */
+ dev_is_connected = Len & 0x1; //wValue passed in Len
break;
case SEND_BREAK:
diff --git a/stm/stmusbd/usbd_pyb_core.c b/stm/stmusbd/usbd_pyb_core.c index ac51e3ad8..d887b89c6 100644 --- a/stm/stmusbd/usbd_pyb_core.c +++ b/stm/stmusbd/usbd_pyb_core.c @@ -648,7 +648,7 @@ static uint8_t usbd_pyb_Setup(void *pdev, USB_SETUP_REQ *req) { // Not a Data request
// Transfer the command to the interface layer */
- return VCP_fops.pIf_Ctrl(req->bRequest, NULL, 0);
+ return VCP_fops.pIf_Ctrl(req->bRequest, NULL, req->wValue);
}
} else if (req->wIndex == 2) {
|
