aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-02-27 23:05:46 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-02-27 23:05:46 +0000
commit86a2be8536d9e246b2a87421c41b78c9fc1f25fc (patch)
tree58bfe301615a21750909a1735a258ddc20a7ae26 /LUFA
parent29ba88cffd4198b02e8ca04c31aed2c175c5502e (diff)
downloadlufa-86a2be8536d9e246b2a87421c41b78c9fc1f25fc.tar.gz
lufa-86a2be8536d9e246b2a87421c41b78c9fc1f25fc.tar.bz2
lufa-86a2be8536d9e246b2a87421c41b78c9fc1f25fc.zip
Fix EVK1101 board joystick driver movement masks.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/Board/EVK1101/Joystick.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/LUFA/Drivers/Board/EVK1101/Joystick.h b/LUFA/Drivers/Board/EVK1101/Joystick.h
index a27c29dd0..eb410deed 100644
--- a/LUFA/Drivers/Board/EVK1101/Joystick.h
+++ b/LUFA/Drivers/Board/EVK1101/Joystick.h
@@ -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 ((1UL << 6) | (1UL << 7) | (1UL << 8) | (1UL << 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 (1UL << 9)
/** Mask for the joystick being pushed inward. */
- #define JOY_PRESS (1 << 7)
+ #define JOY_PRESS (1UL << 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