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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
lufa
Commits
86a2be85
Commit
86a2be85
authored
14 years ago
by
Dean Camera
Browse files
Options
Downloads
Patches
Plain Diff
Fix EVK1101 board joystick driver movement masks.
parent
29ba88cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LUFA/Drivers/Board/EVK1101/Joystick.h
+11
-13
11 additions, 13 deletions
LUFA/Drivers/Board/EVK1101/Joystick.h
with
11 additions
and
13 deletions
LUFA/Drivers/Board/EVK1101/Joystick.h
+
11
−
13
View file @
86a2be85
...
...
@@ -67,29 +67,27 @@
#if !defined(__DOXYGEN__)
/* Macros: */
#define JOY_MOVE_PORT 1
#define JOY_MOVE_MASK ((1 << 6) | (1 << 7) | (1 << 8) | (1 << 9))
#define JOY_MOVE_MASK ((1
UL
<< 6) | (1
UL
<< 7) | (1
UL
<< 8) | (1
UL
<< 9))
#define JOY_PRESS_PORT 0
#define JOY_PRESS_MASK (1 << 13)
#define JOY_SHIFT_LEFT 6
#define JOY_PRESS_MASK (1UL << 13)
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the joystick being pushed in the left direction. */
#define JOY_LEFT (1 << 1)
/** Mask for the joystick being pushed in the right direction. */
#define JOY_RIGHT (1 << 2)
#define JOY_LEFT (1UL << 6)
/** Mask for the joystick being pushed in the upward direction. */
#define JOY_UP (1 << 3)
#define JOY_UP (1UL << 7)
/** Mask for the joystick being pushed in the right direction. */
#define JOY_RIGHT (1UL << 8)
/** Mask for the joystick being pushed in the downward direction. */
#define JOY_DOWN (1 <<
4
)
#define JOY_DOWN
(1
UL
<<
9
)
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS (1 <<
7
)
#define JOY_PRESS
(1
UL
<<
13
)
/* Inline Functions: */
#if !defined(__DOXYGEN__)
...
...
@@ -105,8 +103,8 @@
static
inline
uint32_t
Joystick_GetStatus
(
void
)
ATTR_WARN_UNUSED_RESULT
;
static
inline
uint32_t
Joystick_GetStatus
(
void
)
{
return
(
uint32_t
)(
~
((
(
AVR32_GPIO
.
port
[
JOY_MOVE_PORT
].
pvr
&
JOY_MOVE_MASK
)
|
(
AVR32_GPIO
.
port
[
JOY_PRESS_PORT
].
pvr
&
JOY_PRESS_MASK
))
<<
JOY_SHIFT_LEFT
)
);
return
(
uint32_t
)(
~
((
AVR32_GPIO
.
port
[
JOY_MOVE_PORT
].
pvr
&
JOY_MOVE_MASK
)
|
(
AVR32_GPIO
.
port
[
JOY_PRESS_PORT
].
pvr
&
JOY_PRESS_MASK
)));
}
#endif
...
...
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