summaryrefslogtreecommitdiffstatshomepage
path: root/stm/usb.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-01 16:17:06 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-01 16:17:06 +0000
commitd71cd86dc1b1a95ab1cbe82e4b205407a5fa1199 (patch)
treee60cbf2d586bf12853bf8ae313aa5698fce10181 /stm/usb.c
parent01156d510c728408be4fd3100bcee18e8985ac00 (diff)
parent565fdccfd21b9304a37e9602d33cf64b15781f6a (diff)
downloadmicropython-d71cd86dc1b1a95ab1cbe82e4b205407a5fa1199.tar.gz
micropython-d71cd86dc1b1a95ab1cbe82e4b205407a5fa1199.zip
Merge branch 'iabdalkader-master'
Conflicts: stm/usb.c stm/usb.h
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;