Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lufa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
lufa
Commits
fef185a4
Commit
fef185a4
authored
15 years ago
by
Dean Camera
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup USBMode.h to simplify preprocessor logic.
parent
bb05712e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
LUFA/Drivers/USB/HighLevel/USBMode.h
+10
-21
10 additions, 21 deletions
LUFA/Drivers/USB/HighLevel/USBMode.h
LUFA/Drivers/USB/LowLevel/LowLevel.h
+6
-0
6 additions, 0 deletions
LUFA/Drivers/USB/LowLevel/LowLevel.h
with
16 additions
and
21 deletions
LUFA/Drivers/USB/HighLevel/USBMode.h
+
10
−
21
View file @
fef185a4
...
...
@@ -34,13 +34,6 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
#if ((defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined
(
__AVR_AT90USB162__
)
||
defined
(
__AVR_AT90USB82__
)
||
\
defined
(
__AVR_ATmega16U4__
)
||
defined
(
__AVR_ATmega32U4__
)
||
\
defined
(
__AVR_ATmega32U6__
))
&&
!
defined
(
USB_DEVICE_ONLY
))
#define USB_DEVICE_ONLY
#endif
#if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
defined
(
__AVR_ATmega32U2__
)
||
defined
(
__AVR_ATmega16U2__
)
||
defined
(
__AVR_ATmega8U2__
))
#define USB_SERIES_2_AVR
...
...
@@ -52,31 +45,27 @@
#define USB_SERIES_7_AVR
#endif
#if !defined(USB_SERIES_7_AVR)
#if defined(USB_HOST_ONLY)
#error USB_HOST_ONLY is not available for the currently selected USB AVR model.
#endif
#define USB_DEVICE_ONLY
#endif
#if (!defined(USB_DEVICE_ONLY) && !defined(USB_HOST_ONLY))
#define USB_CAN_BE_BOTH
#define USB_CAN_BE_HOST
#define USB_CAN_BE_DEVICE
#elif defined(USB_HOST_ONLY)
#define USB_CAN_BE_HOST
#define USB_CurrentMode USB_MODE_HOST
#elif defined(USB_DEVICE_ONLY)
#define USB_CAN_BE_DEVICE
#define USB_CurrentMode USB_MODE_DEVICE
#endif
#if (!defined(USB_SERIES_7_AVR) && defined(USB_HOST_ONLY))
#error USB_HOST_ONLY is not available for the currently selected USB AVR model.
#endif
#if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
#error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
#endif
#if defined(USE_STATIC_OPTIONS)
#define USB_Options USE_STATIC_OPTIONS
#endif
#endif
#endif
This diff is collapsed.
Click to expand it.
LUFA/Drivers/USB/LowLevel/LowLevel.h
+
6
−
0
View file @
fef185a4
...
...
@@ -301,6 +301,10 @@
* changed in value.
*/
extern
volatile
uint8_t
USB_CurrentMode
;
#elif defined(USB_HOST_ONLY)
#define USB_CurrentMode USB_MODE_HOST
#elif defined(USB_DEVICE_ONLY)
#define USB_CurrentMode USB_MODE_DEVICE
#endif
#if !defined(USE_STATIC_OPTIONS) || defined(__DOXYGEN__)
...
...
@@ -311,6 +315,8 @@
* changed in value.
*/
extern
volatile
uint8_t
USB_Options
;
#elif defined(USE_STATIC_OPTIONS)
#define USB_Options USE_STATIC_OPTIONS
#endif
/* Private Interface - For use in library only: */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment