Re #4125: New functions usbStart() and usbStop() to make USB code cleaner

This commit is contained in:
Damjan Adamic
2016-12-11 16:28:23 +01:00
parent aecf53b3e1
commit a4d899844e
7 changed files with 16 additions and 10 deletions
@@ -20,6 +20,7 @@
#include "board.h"
#include "usb_dcd_int.h"
#include "usb_bsp.h"
#include "debug.h"
int usbPlugged(void)
@@ -52,6 +53,12 @@ void OTG_FS_IRQHandler(void)
}
void usbInit(void)
{
// Initialize hardware
USB_OTG_BSP_Init(&USB_OTG_dev);
}
void usbStart(void)
{
#if defined(USB_JOYSTICK)
// initialize USB as HID device
@@ -65,7 +72,7 @@ void usbInit(void)
#endif
}
void usbDeInit(void)
void usbStop(void)
{
USBD_DeInit(&USB_OTG_dev);
}