diff options
author | mux <freelancer.c@gmail.com> | 2014-02-01 13:26:04 +0200 |
---|---|---|
committer | mux <freelancer.c@gmail.com> | 2014-02-01 13:28:29 +0200 |
commit | b2269b610e5f29d60d637e9b433275646ea3d53e (patch) | |
tree | 50a9655b1ae1b5a071265fc4394c500b40f115cd /stm/usb.c | |
parent | 532f2c30f66c9ff1e4f2aded29b98ba0db5ec341 (diff) |
Detect VCP line state.
* Detect VCP line state, based on SET_CONTROL_LINE_STATE request
Diffstat (limited to 'stm/usb.c')
-rw-r--r-- | stm/usb.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -20,6 +20,7 @@ extern CDC_IF_Prop_TypeDef VCP_fops; USB_OTG_CORE_HANDLE USB_OTG_Core; static int dev_is_enabled = 0; +int dev_is_connected=0; /* used by usbd_cdc_vcp */ static char rx_buf[64]; static int rx_buf_in; static int rx_buf_out; @@ -41,6 +42,10 @@ bool usb_vcp_is_enabled(void) { return dev_is_enabled; } +bool usb_vcp_is_connected(void) { + return dev_is_connected; +} + void usb_vcp_receive(const char *buf, uint32_t len) { if (dev_is_enabled) { for (int i = 0; i < len; i++) { |