Add missing function attributes to the pipe/endpoint functions for all architectures.
Perform endianness correction in the HID report parser for big-endian platforms.
This commit is contained in:
parent
852b5e612d
commit
995195a2b0
14 changed files with 40 additions and 24 deletions
|
|
@ -137,6 +137,7 @@
|
|||
/** 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.
|
||||
*/
|
||||
static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint16_t USB_Device_GetFrameNumber(void)
|
||||
{
|
||||
return UDFNUM;
|
||||
|
|
@ -191,7 +192,7 @@
|
|||
UDADDR |= (1 << ADDEN);
|
||||
}
|
||||
|
||||
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE;
|
||||
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline bool USB_Device_IsAddressSet(void)
|
||||
{
|
||||
return (UDADDR & (1 << ADDEN));
|
||||
|
|
|
|||
|
|
@ -394,6 +394,7 @@
|
|||
*
|
||||
* \return Total number of busy banks in the selected endpoint.
|
||||
*/
|
||||
static inline uint8_t Endpoint_GetBusyBanks(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint8_t Endpoint_GetBusyBanks(void)
|
||||
{
|
||||
return (UESTA0X & (0x03 << NBUSYBK0));
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@
|
|||
/** 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.
|
||||
*/
|
||||
static inline uint16_t USB_Host_GetFrameNumber(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t USB_Host_GetFrameNumber(void)
|
||||
{
|
||||
return UHFNUM;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
*
|
||||
* \return Boolean \c true if currently sending a HNP to the other connected device, \c false otherwise
|
||||
*/
|
||||
static inline bool USB_OTG_Device_IsSendingHNP(void) ATTR_ALWAYS_INLINE;
|
||||
static inline bool USB_OTG_Device_IsSendingHNP(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline bool USB_OTG_Device_IsSendingHNP(void)
|
||||
{
|
||||
return ((OTGCON & (1 << HNPREQ)) ? true : false);
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@
|
|||
*
|
||||
* \return The current pipe token, as a \c PIPE_TOKEN_* mask.
|
||||
*/
|
||||
static inline uint8_t Pipe_GetPipeToken(void) ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_GetPipeToken(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_GetPipeToken(void)
|
||||
{
|
||||
return (UPCFG0X & (0x03 << PTOKEN0));
|
||||
|
|
@ -433,6 +433,7 @@
|
|||
*
|
||||
* \return Total number of busy banks in the selected pipe.
|
||||
*/
|
||||
static inline uint8_t Pipe_GetBusyBanks(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_GetBusyBanks(void)
|
||||
{
|
||||
return (UPSTAX & (0x03 << NBUSYBK0));
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@
|
|||
/** 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.
|
||||
*/
|
||||
static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint16_t USB_Device_GetFrameNumber(void)
|
||||
{
|
||||
return AVR32_USBB.UDFNUM.fnum;
|
||||
|
|
@ -179,7 +180,7 @@
|
|||
AVR32_USBB.UDCON.adden = true;
|
||||
}
|
||||
|
||||
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE;
|
||||
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline bool USB_Device_IsAddressSet(void)
|
||||
{
|
||||
return AVR32_USBB.UDCON.adden;
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@
|
|||
*
|
||||
* \return Total number of busy banks in the selected endpoint.
|
||||
*/
|
||||
static inline uint8_t Endpoint_GetBusyBanks(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint8_t Endpoint_GetBusyBanks(void)
|
||||
{
|
||||
return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].nbusybk;
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@
|
|||
/** 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.
|
||||
*/
|
||||
static inline uint16_t USB_Host_GetFrameNumber(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t USB_Host_GetFrameNumber(void)
|
||||
{
|
||||
return AVR32_USBB_UHFNUM;
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@
|
|||
*
|
||||
* \return The current pipe token, as a \c PIPE_TOKEN_* mask.
|
||||
*/
|
||||
static inline uint8_t Pipe_GetPipeToken(void) ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_GetPipeToken(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_GetPipeToken(void)
|
||||
{
|
||||
return (&AVR32_USBB.UPCFG0)[USB_SelectedPipe].ptoken;
|
||||
|
|
@ -451,6 +451,7 @@
|
|||
*
|
||||
* \return Total number of busy banks in the selected pipe.
|
||||
*/
|
||||
static inline uint8_t Pipe_GetBusyBanks(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_GetBusyBanks(void)
|
||||
{
|
||||
return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].nbusybk;
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@
|
|||
/* Macros: */
|
||||
#define HOST_TASK_NONBLOCK_WAIT(Duration, NextState) MACROS{ USB_HostState = HOST_STATE_WaitForDevice; \
|
||||
WaitMSRemaining = (Duration); \
|
||||
PostWaitState = (NextState); }MACROE
|
||||
PostWaitState = (NextState); }MACROE
|
||||
#endif
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue