summaryrefslogtreecommitdiffstatshomepage
path: root/stm/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'stm/usb.c')
-rw-r--r--stm/usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stm/usb.c b/stm/usb.c
index 97124f5491..0fe56d3212 100644
--- a/stm/usb.c
+++ b/stm/usb.c
@@ -21,6 +21,7 @@ extern CDC_IF_Prop_TypeDef VCP_fops;
USB_OTG_CORE_HANDLE USB_OTG_Core;
static int dev_is_enabled = 0;
+uint32_t APP_dev_is_connected = 0; /* used by usbd_cdc_vcp */
static char rx_buf[64];
static int rx_buf_in;
static int rx_buf_out;
@@ -48,6 +49,10 @@ bool usb_vcp_is_enabled(void) {
return dev_is_enabled;
}
+bool usb_vcp_is_connected(void) {
+ return APP_dev_is_connected;
+}
+
void usb_vcp_set_interrupt_char(int c) {
if (dev_is_enabled) {
interrupt_char = c;