diff options
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r-- | LUFA/Drivers/Board/EVK1101/Joystick.h | 24 |
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
|