diff options
Diffstat (limited to 'stm/usb.c')
| -rw-r--r-- | stm/usb.c | 13 | 
1 files changed, 9 insertions, 4 deletions
| @@ -12,11 +12,12 @@  extern CDC_IF_Prop_TypeDef VCP_fops; -int is_enabled = 0;  USB_OTG_CORE_HANDLE USB_OTG_dev; -char rx_buf[64]; -int rx_buf_in; -int rx_buf_out; + +static int is_enabled = 0; +static char rx_buf[64]; +static int rx_buf_in; +static int rx_buf_out;  void usb_init() {      USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_PYB_cb, &USR_cb); @@ -25,6 +26,10 @@ void usb_init() {      is_enabled = 1;  } +bool usb_vcp_is_enabled() { +    return is_enabled; +} +  void usb_vcp_receive(const char *buf, uint32_t len) {      if (is_enabled) {          for (int i = 0; i < len; i++) { | 
