Commit 77dbfd3c authored by Dean Camera's avatar Dean Camera
Browse files

Add missing "used" attribute to ATTR_INIT_SECTION to ensure functions declared...

Add missing "used" attribute to ATTR_INIT_SECTION to ensure functions declared with that meta-attribute are not discarded by the linker.

Add missing function and definition documentation.
parent 022fa26b
......@@ -126,7 +126,7 @@
*
* \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.
*
......
......@@ -220,6 +220,8 @@
* 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)
......
......@@ -390,6 +390,8 @@
* \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)
......@@ -419,6 +421,8 @@
* \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)
......@@ -453,6 +457,8 @@
*
* \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);
......
......@@ -76,16 +76,16 @@
/** 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: */
......
......@@ -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
/** @} */
......
......@@ -55,8 +55,6 @@
#define DF_STATUS_BINARYPAGESIZE_ON (1 << 0)
//@}
#define DF_MANUFACTURER_ATMEL 0x1F
/** \name Dataflash Commands */
//@{
#define DF_CMD_GETSTATUS 0xD7
......@@ -109,6 +107,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
/** @} */
......
......@@ -403,6 +403,8 @@
* 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)
......
......@@ -114,7 +114,10 @@
#define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED 0x00000001UL
//@}
/** \name RNDIS Media Types */
//@{
#define REMOTE_NDIS_MEDIUM_802_3 0x00000000UL
//@}
/** \name RNDIS Connection Types */
//@{
......
......@@ -122,6 +122,7 @@
} 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. */
......
......@@ -105,6 +105,7 @@
} 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. */
......
......@@ -148,6 +148,8 @@
/* 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)
......
......@@ -128,6 +128,8 @@
/* 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)
......
......@@ -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();
......
......@@ -669,7 +669,7 @@
{
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,
......
......@@ -145,6 +145,8 @@
/* 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)
......
......@@ -129,6 +129,8 @@
/* 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)
......
......@@ -136,6 +136,8 @@
/* 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment