aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device')
-rw-r--r--LUFA/Drivers/USB/Class/Device/Audio.h24
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.h12
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.h6
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.h4
4 files changed, 28 insertions, 18 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.h b/LUFA/Drivers/USB/Class/Device/Audio.h
index 3586c33e8..b76abf663 100644
--- a/LUFA/Drivers/USB/Class/Device/Audio.h
+++ b/LUFA/Drivers/USB/Class/Device/Audio.h
@@ -135,7 +135,8 @@
*
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
*/
- static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);
+ static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
(void)AudioInterfaceInfo;
@@ -150,7 +151,9 @@
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
*
* \return Boolean true if the given Audio interface has a sample to be read, false otherwise
- */
+ */
+ static inline bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
@@ -171,6 +174,8 @@
* \return Boolean true if the given Audio interface is ready to accept the next sample, false otherwise
*/
static inline bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
+ static inline bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
@@ -188,7 +193,8 @@
*
* \return Signed 8-bit audio sample from the audio interface
*/
- static inline int8_t Audio_Device_ReadSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_ALWAYS_INLINE;
+ static inline int8_t Audio_Device_ReadSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline int8_t Audio_Device_ReadSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
int8_t Sample;
@@ -212,7 +218,8 @@
*
* \return Signed 16-bit audio sample from the audio interface
*/
- static inline int16_t Audio_Device_ReadSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_ALWAYS_INLINE;
+ static inline int16_t Audio_Device_ReadSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline int16_t Audio_Device_ReadSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
int16_t Sample;
@@ -236,7 +243,8 @@
*
* \return Signed 24-bit audio sample from the audio interface
*/
- static inline int32_t Audio_Device_ReadSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_ALWAYS_INLINE;
+ static inline int32_t Audio_Device_ReadSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline int32_t Audio_Device_ReadSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
int32_t Sample;
@@ -260,7 +268,7 @@
* \param[in] Sample Signed 8-bit audio sample
*/
static inline void Audio_Device_WriteSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
- const int8_t Sample) ATTR_ALWAYS_INLINE;
+ const int8_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline void Audio_Device_WriteSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
const int8_t Sample)
{
@@ -279,7 +287,7 @@
* \param[in] Sample Signed 16-bit audio sample
*/
static inline void Audio_Device_WriteSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
- const int16_t Sample) ATTR_ALWAYS_INLINE;
+ const int16_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline void Audio_Device_WriteSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
const int16_t Sample)
{
@@ -298,7 +306,7 @@
* \param[in] Sample Signed 24-bit audio sample
*/
static inline void Audio_Device_WriteSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
- const int32_t Sample) ATTR_ALWAYS_INLINE;
+ const int32_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
static inline void Audio_Device_WriteSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
const int32_t Sample)
{
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.h b/LUFA/Drivers/USB/Class/Device/CDC.h
index 278996f64..23b7b5c40 100644
--- a/LUFA/Drivers/USB/Class/Device/CDC.h
+++ b/LUFA/Drivers/USB/Class/Device/CDC.h
@@ -292,7 +292,8 @@
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
*/
- void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo, FILE* Stream);
+ void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo, FILE* Stream)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Identical to CDC_Device_CreateStream(), except that reads are blocking until the calling stream function terminates
* the transfer. While blocking, the USB and CDC service tasks are called repeatedly to maintain USB communications.
@@ -300,15 +301,16 @@
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
*/
- void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo, FILE* Stream);
+ void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo, FILE* Stream)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_CDC_CLASS_DEVICE_C)
- static int CDC_Device_putchar(char c, FILE* Stream);
- static int CDC_Device_getchar(FILE* Stream);
- static int CDC_Device_getchar_Blocking(FILE* Stream);
+ static int CDC_Device_putchar(char c, FILE* Stream) ATTR_NON_NULL_PTR_ARG(2);
+ static int CDC_Device_getchar(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
+ static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
void CDC_Device_Event_Stub(void);
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h
index b3b67a9a4..d5194d12c 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.h
+++ b/LUFA/Drivers/USB/Class/Device/HID.h
@@ -179,8 +179,8 @@
* \param[in] ReportSize Size in bytes of the received report from the host.
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
- const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1)
- ATTR_NON_NULL_PTR_ARG(4);
+ const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
+ ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4);
/* Inline Functions: */
/** Indicates that a millisecond of idle time has elapsed on the given HID interface, and the interface's idle count should be
@@ -190,7 +190,7 @@
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
*/
- static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);
+ static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_ALWAYS_INLINE ATTR_NON_NULL_PTR_ARG(1);
static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)
{
if (HIDInterfaceInfo->State.IdleMSRemaining)
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.h b/LUFA/Drivers/USB/Class/Device/MIDI.h
index 45791f1a8..d9b67e275 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.h
@@ -135,7 +135,7 @@
*
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum
*/
- uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);
+ uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Receives a MIDI event packet from the host. Events are unpacked from the endpoint, thus if the endpoint bank contains
* multiple MIDI events from the host in the one packet, multiple calls to this function will return each individual event.
@@ -157,7 +157,7 @@
*
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
*/
- static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);
+ static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
{
(void)MIDIInterfaceInfo;