diff options
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Common/BoardTypes.h | 12 | ||||
-rw-r--r-- | LUFA/Drivers/Board/Buttons.h | 4 | ||||
-rw-r--r-- | LUFA/Drivers/Board/Dataflash.h | 4 | ||||
-rw-r--r-- | LUFA/Drivers/Board/Joystick.h | 4 | ||||
-rw-r--r-- | LUFA/Drivers/Board/LEDs.h | 10 | ||||
-rw-r--r-- | LUFA/Drivers/Board/Temperature.h | 4 | ||||
-rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 2 | ||||
-rw-r--r-- | LUFA/ManPages/LUFAPoweredProjects.txt | 2 |
8 files changed, 31 insertions, 11 deletions
diff --git a/LUFA/Common/BoardTypes.h b/LUFA/Common/BoardTypes.h index ccbd4750d..10e31ac1b 100644 --- a/LUFA/Common/BoardTypes.h +++ b/LUFA/Common/BoardTypes.h @@ -89,6 +89,18 @@ /** Selects the EVK527 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers. */
#define BOARD_EVK527 9
+
+ /** Disables board drivers when operation will not be adversely affected (e.g. LEDs) - use of board drivers
+ * such as the Joystick driver, where the removal would adversely affect the code's operation is still disallowed. */
+ #define BOARD_NONE 10
+
+ #if !defined(__DOXYGEN__)
+ #define BOARD_ BOARD_NONE
+
+ #if !defined(BOARD)
+ #define BOARD BOARD_NONE
+ #endif
+ #endif
#endif
diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index d1de8d52e..4e7588c28 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -69,8 +69,8 @@ /* Includes: */
#include "../../Common/Common.h"
- #if !defined(BOARD)
- #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #if (BOARD == BOARD_NONE)
+ #error The Board Buttons driver cannot be used if the makefile BOARD option is not set.
#elif (BOARD == BOARD_USBKEY)
#include "USBKEY/Buttons.h"
#elif (BOARD == BOARD_STK525)
diff --git a/LUFA/Drivers/Board/Dataflash.h b/LUFA/Drivers/Board/Dataflash.h index 3174f1b6c..0197b3e2f 100644 --- a/LUFA/Drivers/Board/Dataflash.h +++ b/LUFA/Drivers/Board/Dataflash.h @@ -150,8 +150,8 @@ }
/* Includes: */
- #if !defined(BOARD)
- #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #if (BOARD == BOARD_NONE)
+ #error The Board Buttons driver cannot be used if the makefile BOARD option is not set.
#elif (BOARD == BOARD_USBKEY)
#include "USBKEY/Dataflash.h"
#elif (BOARD == BOARD_STK525)
diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index 598307b72..be9d267cc 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -68,8 +68,8 @@ /* Includes: */
#include "../../Common/Common.h"
- #if !defined(BOARD)
- #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #if (BOARD == BOARD_NONE)
+ #error The Board Joystick driver cannot be used if the makefile BOARD option is not set.
#elif (BOARD == BOARD_USBKEY)
#include "USBKEY/Joystick.h"
#elif (BOARD == BOARD_STK525)
diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 61f79ceec..222be0e65 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -76,8 +76,14 @@ /* Includes: */
#include "../../Common/Common.h"
- #if !defined(BOARD)
- #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #if (BOARD == BOARD_NONE)
+ static inline void LEDs_Init(void) {};
+ static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) {};
+ static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) {};
+ static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) {};
+ static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) {};
+ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) {};
+ static inline uint8_t LEDs_GetLEDs(void) { return 0; }
#elif (BOARD == BOARD_USBKEY)
#include "USBKEY/LEDs.h"
#elif (BOARD == BOARD_STK525)
diff --git a/LUFA/Drivers/Board/Temperature.h b/LUFA/Drivers/Board/Temperature.h index 1b2baf2fb..86e0b66f0 100644 --- a/LUFA/Drivers/Board/Temperature.h +++ b/LUFA/Drivers/Board/Temperature.h @@ -63,8 +63,8 @@ #include "../../Common/Common.h"
#include "../Peripheral/ADC.h"
- #if !defined(BOARD)
- #error BOARD must be set in makefile to a value specified in BoardTypes.h.
+ #if (BOARD == BOARD_NONE)
+ #error The Board Temperature Sensor driver cannot be used if the makefile BOARD option is not set.
#elif ((BOARD != BOARD_USBKEY) && (BOARD != BOARD_STK525) && \
(BOARD != BOARD_STK526) && (BOARD != BOARD_USER) && \
(BOARD != BOARD_EVK527))
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 63ffaecc8..521ab38f9 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -21,6 +21,8 @@ * - Added ADC MUX masks for the standard ADC input channels on all AVR models with an ADC, altered demos to use these masks
* as on some models, the channel number is not identical to its single-ended ADC MUX mask
* - New Webserver project, a RNDIS host USB webserver using the open source uIP TCP/IP network stack and FatFS library
+ * - New BOARD value option BOARD_NONE (equivelent to not specifying BOARD) which will remove all board hardware drivers which
+ * do not adversely affect the code operation (currently only the LEDs driver)
*
* <b>Changed:</b>
* - Slowed down software USART carried PDI programming in the AVRISP project to prevent transmission errors
diff --git a/LUFA/ManPages/LUFAPoweredProjects.txt b/LUFA/ManPages/LUFAPoweredProjects.txt index e16476882..dfcd712d6 100644 --- a/LUFA/ManPages/LUFAPoweredProjects.txt +++ b/LUFA/ManPages/LUFAPoweredProjects.txt @@ -46,7 +46,6 @@ * - Openkubus, an open source hardware-based authentication dongle: http://code.google.com/p/openkubus/
* - Orbee, a USB connected RGB Orb for notifications: http://www.franksworkshop.com.au/Electronics/Orbee/Orbee.htm
* - Programmable XBOX controller: http://richard-burke.dyndns.org/wordpress/pan-galactic-gargantuan-gargle-brain-aka-xbox-360-usb-controller/
- * - Purdue Interactive Kiosk: https://engineering.purdue.edu/477grp4/
* - Reprap with LUFA, a LUFA powered 3D printer: http://code.google.com/p/at90usb1287-code-for-arduino-and-eclipse/
* - SEGA Megadrive/Genesis Development Cartridge: http://www.makestuff.eu/wordpress/?page_id=398
* - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/
@@ -63,6 +62,7 @@ * - BAP, A tiny LUFA based AVR Programmer: http://www.busware.de/tiki-index.php?page=BAP
* - Digital Survey Instruments Magnetometer and Pointer: http://www.digitalsurveyinstruments.com/
* - Lightweight CC110x USB dongle for 868MHz Protocols: http://busware.de/tiki-index.php?page=CUL
+ * - MIDIFighter, a USB-MIDI controller: http://www.midifighter.com/
* - Mobo 4.3, a USB controlled all band (160-10m) HF SDR transceiver: http://sites.google.com/site/lofturj/mobo4_3
* - SEGA Megadrive/Super Nintendo Cartridge Reader: http://www.snega2usb.com
* - XMEGA Development Board, using LUFA as an On-Board Programmer: http://xmega.mattair.net/
|