diff options
| author | Damien | 2013-10-22 23:09:25 +0100 |
|---|---|---|
| committer | Damien | 2013-10-22 23:09:25 +0100 |
| commit | e9f1e50be49edc6d01ff006e0a1f5291672ec808 (patch) | |
| tree | a1ca33259f91b4941210ef68ae7db075b47c8437 /stm/usb.c | |
| parent | ec63cce470f943003c728fde049919dedd5b6a44 (diff) | |
Board running boot.py, working REPL, soft reboot.
Diffstat (limited to 'stm/usb.c')
| -rw-r--r-- | stm/usb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -20,7 +20,10 @@ 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); + if (!is_enabled) { + // only init USB once in the device's power-lifetime + USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_PYB_cb, &USR_cb); + } rx_buf_in = 0; rx_buf_out = 0; is_enabled = 1; |
