#if !defined(__DOXYGEN__)\r
/* Macros: */\r
#define JOY_MOVE_PORT 1\r
- #define JOY_MOVE_MASK ((1 << 6) | (1 << 7) | (1 << 8) | (1 << 9))\r
+ #define JOY_MOVE_MASK ((1UL << 6) | (1UL << 7) | (1UL << 8) | (1UL << 9))\r
#define JOY_PRESS_PORT 0\r
- #define JOY_PRESS_MASK (1 << 13)\r
- \r
- #define JOY_SHIFT_LEFT 6\r
+ #define JOY_PRESS_MASK (1UL << 13)\r
#endif\r
\r
/* Public Interface - May be used in end-application: */\r
/* Macros: */\r
/** Mask for the joystick being pushed in the left direction. */\r
- #define JOY_LEFT (1 << 1)\r
-\r
- /** Mask for the joystick being pushed in the right direction. */\r
- #define JOY_RIGHT (1 << 2)\r
+ #define JOY_LEFT (1UL << 6)\r
\r
/** Mask for the joystick being pushed in the upward direction. */\r
- #define JOY_UP (1 << 3)\r
+ #define JOY_UP (1UL << 7)\r
+\r
+ /** Mask for the joystick being pushed in the right direction. */\r
+ #define JOY_RIGHT (1UL << 8)\r
\r
/** Mask for the joystick being pushed in the downward direction. */\r
- #define JOY_DOWN (1 << 4)\r
+ #define JOY_DOWN (1UL << 9)\r
\r
/** Mask for the joystick being pushed inward. */\r
- #define JOY_PRESS (1 << 7)\r
+ #define JOY_PRESS (1UL << 13)\r
\r
/* Inline Functions: */\r
#if !defined(__DOXYGEN__)\r
static inline uint32_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;\r
static inline uint32_t Joystick_GetStatus(void)\r
{\r
- return (uint32_t)(~(((AVR32_GPIO.port[JOY_MOVE_PORT].pvr & JOY_MOVE_MASK) |\r
- (AVR32_GPIO.port[JOY_PRESS_PORT].pvr & JOY_PRESS_MASK)) << JOY_SHIFT_LEFT));\r
+ return (uint32_t)(~((AVR32_GPIO.port[JOY_MOVE_PORT].pvr & JOY_MOVE_MASK) |\r
+ (AVR32_GPIO.port[JOY_PRESS_PORT].pvr & JOY_PRESS_MASK)));\r
}\r
#endif\r
\r