projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More porting of the USB core to the AVR32.
[pub/lufa.git]
/
LUFA
/
Drivers
/
USB
/
LowLevel
/
LowLevel.h
diff --git
a/LUFA/Drivers/USB/LowLevel/LowLevel.h
b/LUFA/Drivers/USB/LowLevel/LowLevel.h
index
581dfd1
..
2c8ade7
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/LowLevel.h
+++ b/
LUFA/Drivers/USB/LowLevel/LowLevel.h
@@
-39,6
+39,15
@@
#ifndef __USBLOWLEVEL_H__
\r
#define __USBLOWLEVEL_H__
\r
\r
#ifndef __USBLOWLEVEL_H__
\r
#define __USBLOWLEVEL_H__
\r
\r
+ /* External Variables: */
\r
+ #if defined(__AVR32__)
\r
+ #if !defined(CONTROL_ONLY_DEVICE)
\r
+ extern uint8_t USB_SelectedEPNumber;
\r
+ #else
\r
+ #define USB_SelectedEPNumber 0
\r
+ #endif
\r
+ #endif
\r
+
\r
/* Includes: */
\r
#if defined(__AVR32__)
\r
#include <avr32/io.h>
\r
/* Includes: */
\r
#if defined(__AVR32__)
\r
#include <avr32/io.h>
\r
@@
-77,7
+86,7
@@
\r
/* Preprocessor Checks and Defines: */
\r
#if !defined(__INCLUDE_FROM_USB_DRIVER)
\r
\r
/* Preprocessor Checks and Defines: */
\r
#if !defined(__INCLUDE_FROM_USB_DRIVER)
\r
- #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
\r
+ #error Do not include this file directly. Include LUFA/Drivers/USB
/USB
.h instead.
\r
#endif
\r
\r
#if !defined(F_CLOCK)
\r
#endif
\r
\r
#if !defined(F_CLOCK)
\r
@@
-354,16
+363,22
@@
#define USB_Controller_Disable() MACROS{ USBCON &= ~(1 << USBE); }MACROE
\r
#define USB_Controller_Reset() MACROS{ const uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \
\r
USBCON = (Temp | (1 << USBE)); }MACROE
\r
#define USB_Controller_Disable() MACROS{ USBCON &= ~(1 << USBE); }MACROE
\r
#define USB_Controller_Reset() MACROS{ const uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \
\r
USBCON = (Temp | (1 << USBE)); }MACROE
\r
-
\r
/* Inline Functions: */
\r
#if defined(USB_CAN_BE_BOTH)
\r
static inline uint8_t USB_GetUSBModeFromUID(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
\r
static inline uint8_t USB_GetUSBModeFromUID(void)
\r
{
\r
/* Inline Functions: */
\r
#if defined(USB_CAN_BE_BOTH)
\r
static inline uint8_t USB_GetUSBModeFromUID(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
\r
static inline uint8_t USB_GetUSBModeFromUID(void)
\r
{
\r
+ #if defined(__AVR32__)
\r
+ if (AVR32_USBB.USBSTA.id)
\r
+ return USB_MODE_DEVICE;
\r
+ else
\r
+ return USB_MODE_HOST;
\r
+ #elif defined(__AVR__)
\r
if (USBSTA & (1 << ID))
\r
return USB_MODE_DEVICE;
\r
else
\r
return USB_MODE_HOST;
\r
if (USBSTA & (1 << ID))
\r
return USB_MODE_DEVICE;
\r
else
\r
return USB_MODE_HOST;
\r
+ #endif
\r
}
\r
#endif
\r
\r
}
\r
#endif
\r
\r