aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Board/LEDs.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-05-05 14:02:02 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-05-05 14:02:02 +0000
commitf11f69fd2989899b3088ea7d11b981f2d68c05e0 (patch)
tree41b86aed89f0697733202b705c506d9cde4a7e87 /LUFA/Drivers/Board/LEDs.h
parent253deb996f321c59c102a64e17f95d0b5b0a0e6d (diff)
downloadlufa-f11f69fd2989899b3088ea7d11b981f2d68c05e0.tar.gz
lufa-f11f69fd2989899b3088ea7d11b981f2d68c05e0.tar.bz2
lufa-f11f69fd2989899b3088ea7d11b981f2d68c05e0.zip
Fixed missing semicolon in the ATAVRUSBRF01 LED board driver code, changed LED board driver code to define dummy LED masks for the first four board LEDs so that user code can be compiled for boards with less than four LEDs without code modifications (thanks to Morten Lund).
Diffstat (limited to 'LUFA/Drivers/Board/LEDs.h')
-rw-r--r--LUFA/Drivers/Board/LEDs.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h
index 1874dfde3..f65e67c81 100644
--- a/LUFA/Drivers/Board/LEDs.h
+++ b/LUFA/Drivers/Board/LEDs.h
@@ -53,6 +53,14 @@
* If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project
* directory. Otherwise, it will include the appropriate built in board driver header file.
*
+ * \note To make code as compatible as possible, it is assumed that all boards carry a minimum of four LEDs. If
+ * a board contains less than four LEDs, the remaining LED masks are defined to 0 so as to have no effect.
+ * If other behaviour is desired, either alias the remaining LED masks to existing LED masks via the -D
+ * switch in the project makefile, or alias them to nothing in the makefile to cause compilation errors when
+ * a non-existing LED is referenced in application code. Note that this means that it is possible to make
+ * compatible code for a board with no LEDs by making a board LED driver (see \ref Page_WritingBoardDrivers)
+ * which contains only stub functions and defines no LEDs.
+ *
* @{
*/
@@ -84,6 +92,22 @@
#include "Board/LEDs.h"
#endif
+ #if !defined(LEDS_LED1)
+ #define LEDS_LED1 0
+ #endif
+
+ #if !defined(LEDS_LED2)
+ #define LEDS_LED2 0
+ #endif
+
+ #if !defined(LEDS_LED3)
+ #define LEDS_LED3 0
+ #endif
+
+ #if !defined(LEDS_LED4)
+ #define LEDS_LED4 0
+ #endif
+
/* Pseudo-Functions for Doxygen: */
#if defined(__DOXYGEN__)
/** Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port