projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Adafruit's Atmega32u4 breakout board
[pub/lufa.git]
/
LUFA
/
Drivers
/
Board
/
Joystick.h
diff --git
a/LUFA/Drivers/Board/Joystick.h
b/LUFA/Drivers/Board/Joystick.h
index
ecebcc5
..
b0a31a5
100644
(file)
--- a/
LUFA/Drivers/Board/Joystick.h
+++ b/
LUFA/Drivers/Board/Joystick.h
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
2
.
+ Copyright (C) Dean Camera, 201
8
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
2
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
8
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-47,11
+47,11
@@
* \defgroup Group_Joystick Joystick Driver - LUFA/Drivers/Board/Joystick.h
* \brief Digital joystick board hardware driver.
*
* \defgroup Group_Joystick Joystick Driver - LUFA/Drivers/Board/Joystick.h
* \brief Digital joystick board hardware driver.
*
- * \section Sec_Dependencies Module Source Dependencies
+ * \section Sec_
Joystick_
Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - None
*
* The following files must be built with any user project that uses this module:
* - None
*
- * \section Sec_ModDescription Module Description
+ * \section Sec_
Joystick_
ModDescription Module Description
* Hardware Joystick driver. This module provides an easy to use interface to control the hardware digital Joystick
* located on many boards.
*
* Hardware Joystick driver. This module provides an easy to use interface to control the hardware digital Joystick
* located on many boards.
*
@@
-60,29
+60,29
@@
*
* For possible \c BOARD makefile values, see \ref Group_BoardTypes.
*
*
* For possible \c BOARD makefile values, see \ref Group_BoardTypes.
*
- * \section Sec_ExampleUsage Example Usage
+ * \section Sec_
Joystick_
ExampleUsage Example Usage
* The following snippet is an example of how this module may be used within a typical
* application.
*
* \code
* // Initialize the board Joystick driver before first use
* Joystick_Init();
* The following snippet is an example of how this module may be used within a typical
* application.
*
* \code
* // Initialize the board Joystick driver before first use
* Joystick_Init();
- *
+ *
* printf("Waiting for joystick movement...\r\n");
* printf("Waiting for joystick movement...\r\n");
- *
+ *
* // Loop until a the joystick has been moved
* uint8_t JoystickMovement;
* while (!(JoystickMovement = Joystick_GetStatus())) {};
* // 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");
* // 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_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_LEFT | JOY_RIGHT))
* printf("%s ", (JoystickMovement & JOY_LEFT) ? "Left" : "Right");
- *
+ *
* if (JoystickMovement & JOY_PRESS)
* printf("Pressed");
* \endcode
* if (JoystickMovement & JOY_PRESS)
* printf("Pressed");
* \endcode
@@
-100,7
+100,14
@@
#include "../../Common/Common.h"
#if (BOARD == BOARD_NONE)
#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 void Joystick_Disable(void) {}
+ static inline uint_reg_t Joystick_GetStatus(void) { return 0; }
#elif (BOARD == BOARD_USBKEY)
#include "AVR8/USBKEY/Joystick.h"
#elif (BOARD == BOARD_STK525)
#elif (BOARD == BOARD_USBKEY)
#include "AVR8/USBKEY/Joystick.h"
#elif (BOARD == BOARD_STK525)