[AVR] Fix USB support for ATmega32U4
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9488 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
06f9534388
commit
ba84b3cc23
|
@ -445,7 +445,12 @@ void usb_lld_stop(USBDriver *usbp) {
|
||||||
#if AVR_USB_USE_USB1 == TRUE
|
#if AVR_USB_USE_USB1 == TRUE
|
||||||
if (&USBD1 == usbp) {
|
if (&USBD1 == usbp) {
|
||||||
/* Disable and clear transition interrupts */
|
/* Disable and clear transition interrupts */
|
||||||
|
#if !defined(__AVR_ATmega32U4__)
|
||||||
USBCON &= ~((1 << VBUSTE) | (1 << IDTE));
|
USBCON &= ~((1 << VBUSTE) | (1 << IDTE));
|
||||||
|
#else
|
||||||
|
USBCON &= ~(1 << VBUSTE);
|
||||||
|
#endif
|
||||||
|
|
||||||
USBINT = 0;
|
USBINT = 0;
|
||||||
|
|
||||||
/* Disable and clear device interrupts */
|
/* Disable and clear device interrupts */
|
||||||
|
@ -481,7 +486,10 @@ void usb_lld_reset(USBDriver *usbp) {
|
||||||
|
|
||||||
/* Set Device mode */
|
/* Set Device mode */
|
||||||
/* TODO: Support HOST/OTG mode if needed */
|
/* TODO: Support HOST/OTG mode if needed */
|
||||||
|
|
||||||
|
#if !defined(__AVR_ATmega32U4__)
|
||||||
UHWCON |= (1 << UIMOD);
|
UHWCON |= (1 << UIMOD);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set FULL 12mbps speed */
|
/* Set FULL 12mbps speed */
|
||||||
UDCON &= ~(1 << LSM);
|
UDCON &= ~(1 << LSM);
|
||||||
|
|
Loading…
Reference in New Issue