From ba84b3cc239d4cfdf8fc16b8c4bde12593698430 Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Sun, 15 May 2016 12:16:10 +0000 Subject: [AVR] Fix USB support for ATmega32U4 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9488 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/AVR/hal_usb_lld.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'os/hal/ports') diff --git a/os/hal/ports/AVR/hal_usb_lld.c b/os/hal/ports/AVR/hal_usb_lld.c index e6fb42f1e..1185a48db 100644 --- a/os/hal/ports/AVR/hal_usb_lld.c +++ b/os/hal/ports/AVR/hal_usb_lld.c @@ -445,7 +445,12 @@ void usb_lld_stop(USBDriver *usbp) { #if AVR_USB_USE_USB1 == TRUE if (&USBD1 == usbp) { /* Disable and clear transition interrupts */ +#if !defined(__AVR_ATmega32U4__) USBCON &= ~((1 << VBUSTE) | (1 << IDTE)); +#else + USBCON &= ~(1 << VBUSTE); +#endif + USBINT = 0; /* Disable and clear device interrupts */ @@ -481,7 +486,10 @@ void usb_lld_reset(USBDriver *usbp) { /* Set Device mode */ /* TODO: Support HOST/OTG mode if needed */ + +#if !defined(__AVR_ATmega32U4__) UHWCON |= (1 << UIMOD); +#endif /* Set FULL 12mbps speed */ UDCON &= ~(1 << LSM); -- cgit v1.2.3