diff options
author | Fabio Utzig <utzig@utzig.org> | 2016-05-15 12:16:10 +0000 |
---|---|---|
committer | Fabio Utzig <utzig@utzig.org> | 2016-05-15 12:16:10 +0000 |
commit | ba84b3cc239d4cfdf8fc16b8c4bde12593698430 (patch) | |
tree | 299436d776dbf769e1eed1bfa0cdda41d4699a98 /os | |
parent | 06f9534388d942b2e94ae8b7deda6f60e2914fb1 (diff) | |
download | ChibiOS-ba84b3cc239d4cfdf8fc16b8c4bde12593698430.tar.gz ChibiOS-ba84b3cc239d4cfdf8fc16b8c4bde12593698430.tar.bz2 ChibiOS-ba84b3cc239d4cfdf8fc16b8c4bde12593698430.zip |
[AVR] Fix USB support for ATmega32U4
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9488 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/AVR/hal_usb_lld.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |