Fixed missing semicolon in the ATAVRUSBRF01 LED board driver code, changed LED board...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 5 May 2009 14:02:02 +0000 (14:02 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 5 May 2009 14:02:02 +0000 (14:02 +0000)
LUFA/ChangeLog.txt
LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h
LUFA/Drivers/Board/LEDs.h

index 2c40ba8..d538e35 100644 (file)
@@ -74,6 +74,9 @@
   *  - Fixed reversed signature byte ordering in the CDC bootloader (thanks to Johannes Raschke)\r
   *  - Changed PIPE_CONTROLPIPE_DEFAULT_SIZE from 8 to 64 to try to prevent problems with faulty devices which do not respect the given\r
   *    wLength value when reading in the device descriptor\r
+  *  - Fixed missing semicolon in the ATAVRUSBRF01 LED board driver code (thanks to Morten Lund)\r
+  *  - 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\r
+  *    with less than four LEDs without code modifications (thanks to Morten Lund)\r
   *    \r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
index a073d2e..9f80827 100644 (file)
                        \r
                        static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)\r
                        {\r
-                               PORTD = (PORTD & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS))\r
+                               PORTD = ((PORTD & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS));\r
                        }\r
                        \r
                        static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;\r
index 1874dfd..f65e67c 100644 (file)
  *  If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project\r
  *  directory. Otherwise, it will include the appropriate built in board driver header file.\r
  *\r
+ *  \note To make code as compatible as possible, it is assumed that all boards carry a minimum of four LEDs. If\r
+ *        a board contains less than four LEDs, the remaining LED masks are defined to 0 so as to have no effect.\r
+ *        If other behaviour is desired, either alias the remaining LED masks to existing LED masks via the -D \r
+ *        switch in the project makefile, or alias them to nothing in the makefile to cause compilation errors when\r
+ *        a non-existing LED is referenced in application code. Note that this means that it is possible to make\r
+ *        compatible code for a board with no LEDs by making a board LED driver (see \ref Page_WritingBoardDrivers)\r
+ *        which contains only stub functions and defines no LEDs.\r
+ *\r
  *  @{\r
  */\r
 \r
                #include "Board/LEDs.h"\r
        #endif\r
        \r
+       #if !defined(LEDS_LED1)\r
+               #define LEDS_LED1      0\r
+       #endif\r
+\r
+       #if !defined(LEDS_LED2)\r
+               #define LEDS_LED2      0\r
+       #endif\r
+\r
+       #if !defined(LEDS_LED3)\r
+               #define LEDS_LED3      0\r
+       #endif\r
+\r
+       #if !defined(LEDS_LED4)\r
+               #define LEDS_LED4      0\r
+       #endif\r
+       \r
        /* Pseudo-Functions for Doxygen: */\r
        #if defined(__DOXYGEN__)\r
                /** Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port\r