Add missing "used" attribute to ATTR_INIT_SECTION to ensure functions declared with...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 22 Sep 2011 05:55:32 +0000 (05:55 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 22 Sep 2011 05:55:32 +0000 (05:55 +0000)
Add missing function and definition documentation.

17 files changed:
LUFA/Common/Attributes.h
LUFA/Common/Common.h
LUFA/Common/Endianness.h
LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h
LUFA/Drivers/Misc/AT45DB321C.h
LUFA/Drivers/Misc/AT45DB642D.h
LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h
LUFA/Drivers/USB/Class/Common/RNDIS.h
LUFA/Drivers/USB/Class/Host/MassStorage.h
LUFA/Drivers/USB/Class/Host/Printer.h
LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h
LUFA/Drivers/USB/Core/DeviceStandardReq.c
LUFA/Drivers/USB/Core/StdDescriptors.h
LUFA/Drivers/USB/Core/UC3/Device_UC3.h
LUFA/Drivers/USB/Core/UC3/Host_UC3.h
LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h

index d6722a2..7ee6413 100644 (file)
                         *
                         *  \param[in] SectionIndex  Initialization section number where the function should be placed.
                         */
-                       #define ATTR_INIT_SECTION(SectionIndex) __attribute__ ((naked, section (".init" #SectionIndex )))
+                       #define ATTR_INIT_SECTION(SectionIndex) __attribute__ ((used, naked, section (".init" #SectionIndex )))
 
                        /** Marks a function as an alias for another function.
                         *
index e9faf7a..a948504 100644 (file)
                         *  etc.
                         *
                         *  \param[in] Byte  Byte of data whose bits are to be reversed.
+                        *
+                        *  \return Input data with the individual bits reversed (mirrored).
                         */
                        static inline uint8_t BitReverse(uint8_t Byte) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
                        static inline uint8_t BitReverse(uint8_t Byte)
index 6e84626..6b57ed6 100644 (file)
                         *  \ingroup Group_ByteSwapping
                         *
                         *  \param[in] Word  Word of data whose bytes are to be swapped.
+                        *
+                        *  \return Input data with the individual bytes reversed.
                         */
                        static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
                        static inline uint16_t SwapEndian_16(const uint16_t Word)
                         *  \ingroup Group_ByteSwapping
                         *
                         *  \param[in] DWord  Double word of data whose bytes are to be swapped.
+                        *
+                        *  \return Input data with the individual bytes reversed.
                         */
                        static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
                        static inline uint32_t SwapEndian_32(const uint32_t DWord)
                         *
                         *  \param[in,out] Data    Pointer to a number containing an even number of bytes to be reversed.
                         *  \param[in]     Length  Length of the data in bytes.
+                        *
+                        *  \return Input data with the individual bytes reversed.
                         */
                        static inline void SwapEndian_n(void* const Data,
                                                        uint8_t Length) ATTR_NON_NULL_PTR_ARG(1);
index 113505a..42b9b77 100644 (file)
                        /** Mask for the first dataflash chip selected. */
                        #define DATAFLASH_CHIP1                      0
 
-                       #if (BOARD == BOARD_XPLAIN_REV1)
-                               #define DATAFLASH_PAGE_SIZE              256
-
-                               #define DATAFLASH_PAGES                  2048
-                       #else
+                       #if ((BOARD != BOARD_XPLAIN_REV1) || defined(__DOXYGEN__))
                                /** Internal main memory page size for the board's dataflash ICs. */
                                #define DATAFLASH_PAGE_SIZE              1024
 
                                /** Total number of pages inside each of the board's dataflash ICs. */
                                #define DATAFLASH_PAGES                  8192
+                       #else
+                               #define DATAFLASH_PAGE_SIZE              256
+
+                               #define DATAFLASH_PAGES                  2048
                        #endif
 
                /* Inline Functions: */
index e06cdc4..47b8292 100644 (file)
@@ -54,8 +54,6 @@
                        #define DF_STATUS_SECTORPROTECTION_ON           (1 << 1)
                        //@}
 
-                       #define DF_MANUFACTURER_ATMEL                   0x1F
-
                        /** \name Dataflash Commands */
                        //@{
                        #define DF_CMD_GETSTATUS                        0xD7
@@ -93,6 +91,9 @@
                        #define DF_CMD_READMANUFACTURERDEVICEINFO       0x9F
                        //@}
 
+                       /** Manufacturer code for Atmel Corporation, returned by Atmel Dataflash ICs in response to the \c DF_CMD_READMANUFACTURERDEVICEINFO command. */
+                       #define DF_MANUFACTURER_ATMEL                   0x1F
+
 #endif
 
 /** @} */
index cc8a641..afd36f1 100644 (file)
@@ -55,8 +55,6 @@
                        #define DF_STATUS_BINARYPAGESIZE_ON             (1 << 0)
                        //@}
 
-                       #define DF_MANUFACTURER_ATMEL                   0x1F
-
                        /** \name Dataflash Commands */
                        //@{
                        #define DF_CMD_GETSTATUS                        0xD7
                        #define DF_CMD_READMANUFACTURERDEVICEINFO       0x9F
                        //@}
 
+                       /** Manufacturer code for Atmel Corporation, returned by Atmel Dataflash ICs in response to the \c DF_CMD_READMANUFACTURERDEVICEINFO command. */
+                       #define DF_MANUFACTURER_ATMEL                   0x1F
+
 #endif
 
 /** @} */
index 437b4d1..5ba789e 100644 (file)
                         *        the results read directly from the \ref ADC_GetResult() instead to reduce overhead.
                         *
                         *  \param[in] MUXMask  Mask comprising of an ADC channel mask, reference mask and adjustment mask.
+                        *
+                        *  \return Converted ADC result for the given ADC channel.
                         */
                        static inline uint16_t ADC_GetChannelReading(const uint16_t MUXMask) ATTR_WARN_UNUSED_RESULT;
                        static inline uint16_t ADC_GetChannelReading(const uint16_t MUXMask)
index 05ab13b..f931de8 100644 (file)
                #define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED  0x00000001UL
                //@}
                
+               /** \name RNDIS Media Types */
+               //@{
                #define REMOTE_NDIS_MEDIUM_802_3              0x00000000UL
+               //@}
 
                /** \name RNDIS Connection Types */
                //@{
index ff336f8..f0dd475 100644 (file)
                        } SCSI_Capacity_t;
 
                /* Enums: */
+                       /** Enum for the possible error codes returned by the \ref MS_Host_ConfigurePipes() function. */
                        enum MS_Host_EnumerationFailure_ErrorCodes_t
                        {
                                MS_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully. */
index d9de036..9f5c816 100644 (file)
                        } USB_ClassInfo_PRNT_Host_t;
 
                /* Enums: */
+                       /** Enum for the possible error codes returned by the \ref PRNT_Host_ConfigurePipes() function. */
                        enum PRNT_Host_EnumerationFailure_ErrorCodes_t
                        {
                                PRNT_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully. */
index 08604ac..ec41f5d 100644 (file)
                /* Inline Functions: */
                        /** Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host)
                         *  the frame number is incremented by one.
+                        *
+                        *  \return Current USB frame number from the USB controller.
                         */
                        static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
                        static inline uint16_t USB_Device_GetFrameNumber(void)
index b97c45c..8dbeaa2 100644 (file)
                /* Inline Functions: */
                        /** Returns the current USB frame number, when in host mode. Every millisecond the USB bus is active (i.e. not suspended)
                         *  the frame number is incremented by one.
+                        *
+                        *  \return Current USB frame number from the USB controller.
                         */
                        static inline uint16_t USB_Host_GetFrameNumber(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t USB_Host_GetFrameNumber(void)
index c3a111e..59d3f28 100644 (file)
@@ -48,11 +48,18 @@ bool    USB_Device_RemoteWakeupEnabled;
 
 void USB_Device_ProcessControlRequest(void)
 {
+       #if defined(ARCH_BIG_ENDIAN)
        USB_ControlRequest.bmRequestType = Endpoint_Read_8();
        USB_ControlRequest.bRequest      = Endpoint_Read_8();
        USB_ControlRequest.wValue        = Endpoint_Read_16_LE();
        USB_ControlRequest.wIndex        = Endpoint_Read_16_LE();
        USB_ControlRequest.wLength       = Endpoint_Read_16_LE();
+       #else
+       uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;
+
+       for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++)
+         *(RequestHeader++) = Endpoint_Read_8();
+       #endif
 
        EVENT_USB_Device_ControlRequest();
 
index a37ea09..f5bacf8 100644 (file)
                        {
                                USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
 
-                               #if ((ARCH == ARCH_AVR8) || (ARCH == ARCH_XMEGA))
+                               #if (((ARCH == ARCH_AVR8) || (ARCH == ARCH_XMEGA)) && !defined(__DOXYGEN__))
                                wchar_t  UnicodeString[];
                                #else
                                uint16_t UnicodeString[]; /**< String data, as unicode characters (alternatively,
index fa034b5..a4bdab0 100644 (file)
                /* Inline Functions: */
                        /** Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host)
                         *  the frame number is incremented by one.
+                        *
+                        *  \return Current USB frame number from the USB controller.
                         */
                        static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
                        static inline uint16_t USB_Device_GetFrameNumber(void)
index 61e82f1..60d9b7f 100644 (file)
                /* Inline Functions: */
                        /** Returns the current USB frame number, when in host mode. Every millisecond the USB bus is active (i.e. not suspended)
                         *  the frame number is incremented by one.
+                        *
+                        *  \return Current USB frame number from the USB controller.
                         */
                        static inline uint16_t USB_Host_GetFrameNumber(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t USB_Host_GetFrameNumber(void)
index 0cc53e1..8764ea1 100644 (file)
                /* Inline Functions: */
                        /** Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host)
                         *  the frame number is incremented by one.
+                        *
+                        *  \return Current USB frame number from the USB controller.
                         */
                        static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
                        static inline uint16_t USB_Device_GetFrameNumber(void)