diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2013-05-19 21:49:36 +0200 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-05-19 21:49:36 +0200 |
commit | 2bb012d4cbff052ff186c82cc2269b2362118972 (patch) | |
tree | 24fe391ddc37a88dae958e039666be1e18e70c66 /LUFA/Drivers/Board/Joystick.h | |
parent | 654baf7d609963cf25da328f2b3fc8ced0eaf68a (diff) | |
download | lufa-2bb012d4cbff052ff186c82cc2269b2362118972.tar.gz lufa-2bb012d4cbff052ff186c82cc2269b2362118972.tar.bz2 lufa-2bb012d4cbff052ff186c82cc2269b2362118972.zip |
Add stub functions to all board drivers, so that demos can be compiled with BOARD=NONE.
Diffstat (limited to 'LUFA/Drivers/Board/Joystick.h')
-rw-r--r-- | LUFA/Drivers/Board/Joystick.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index e39c225e4..c3b306e06 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -67,22 +67,22 @@ * \code * // Initialize the board Joystick driver before first use * Joystick_Init(); - * + * * printf("Waiting for joystick movement...\r\n"); - * + * * // Loop until a the joystick has been moved * uint8_t JoystickMovement; * while (!(JoystickMovement = Joystick_GetStatus())) {}; - * + * * // Display which direction the joystick was moved in * printf("Joystick moved:\r\n"); - * + * * if (JoystickMovement & (JOY_UP | JOY_DOWN)) * printf("%s ", (JoystickMovement & JOY_UP) ? "Up" : "Down"); - * + * * if (JoystickMovement & (JOY_LEFT | JOY_RIGHT)) * printf("%s ", (JoystickMovement & JOY_LEFT) ? "Left" : "Right"); - * + * * if (JoystickMovement & JOY_PRESS) * printf("Pressed"); * \endcode @@ -100,7 +100,13 @@ #include "../../Common/Common.h" #if (BOARD == BOARD_NONE) - #error The Board Joystick driver cannot be used if the makefile BOARD option is not set. + #define JOY_UP 0 + #define JOY_DOWN 0 + #define JOY_LEFT 0 + #define JOY_RIGHT 0 + #define JOY_PRESS 0 + static inline void Joystick_Init(void) {}; + static inline uint_reg_t Joystick_GetStatus(void) { return 0; }; #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/Joystick.h" #elif (BOARD == BOARD_STK525) |