Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
03130342
Commit
03130342
authored
Jul 13, 2010
by
Dean Camera
Browse files
Added const attributes to some of the class driver function parameters that were missing it.
parent
3a3a4e2a
Changes
36
Hide whitespace changes
Inline
Side-by-side
Demos/Device/ClassDriver/GenericHID/GenericHID.c
View file @
03130342
...
...
@@ -144,7 +144,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
if
(
HIDReportEcho
.
ReportID
)
*
ReportID
=
HIDReportEcho
.
ReportID
;
...
...
Demos/Device/ClassDriver/GenericHID/GenericHID.h
View file @
03130342
...
...
@@ -73,7 +73,7 @@
void
EVENT_USB_Device_StartOfFrame
(
void
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
Demos/Device/ClassDriver/Joystick/Joystick.c
View file @
03130342
...
...
@@ -138,7 +138,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
USB_JoystickReport_Data_t
*
JoystickReport
=
(
USB_JoystickReport_Data_t
*
)
ReportData
;
...
...
Demos/Device/ClassDriver/Joystick/Joystick.h
View file @
03130342
...
...
@@ -86,7 +86,7 @@
void
EVENT_USB_Device_StartOfFrame
(
void
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
Demos/Device/ClassDriver/Keyboard/Keyboard.c
View file @
03130342
...
...
@@ -138,7 +138,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
USB_KeyboardReport_Data_t
*
KeyboardReport
=
(
USB_KeyboardReport_Data_t
*
)
ReportData
;
...
...
Demos/Device/ClassDriver/Keyboard/Keyboard.h
View file @
03130342
...
...
@@ -76,7 +76,7 @@
void
EVENT_USB_Device_StartOfFrame
(
void
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
View file @
03130342
...
...
@@ -166,7 +166,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
uint8_t
JoyStatus_LCL
=
Joystick_GetStatus
();
uint8_t
ButtonStatus_LCL
=
Buttons_GetStatus
();
...
...
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h
View file @
03130342
...
...
@@ -71,7 +71,7 @@
void
EVENT_USB_Device_StartOfFrame
(
void
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
View file @
03130342
...
...
@@ -186,7 +186,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
USB_KeyboardReport_Data_t
*
KeyboardReport
=
(
USB_KeyboardReport_Data_t
*
)
ReportData
;
...
...
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
View file @
03130342
...
...
@@ -93,7 +93,7 @@
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
Demos/Device/ClassDriver/Mouse/Mouse.c
View file @
03130342
...
...
@@ -138,7 +138,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
USB_MouseReport_Data_t
*
MouseReport
=
(
USB_MouseReport_Data_t
*
)
ReportData
;
...
...
Demos/Device/ClassDriver/Mouse/Mouse.h
View file @
03130342
...
...
@@ -77,7 +77,7 @@
void
EVENT_USB_Device_StartOfFrame
(
void
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
View file @
03130342
...
...
@@ -200,7 +200,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
USB_MouseReport_Data_t
*
MouseReport
=
(
USB_MouseReport_Data_t
*
)
ReportData
;
...
...
Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h
View file @
03130342
...
...
@@ -77,7 +77,7 @@
void
EVENT_USB_Device_StartOfFrame
(
void
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
#endif
Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c
View file @
03130342
...
...
@@ -105,7 +105,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
{
USB_MouseReport_Data_t
*
MouseReport
=
(
USB_MouseReport_Data_t
*
)
ReportData
;
...
...
Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.h
View file @
03130342
...
...
@@ -44,7 +44,7 @@
/* Function Prototypes: */
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
);
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
);
...
...
LUFA/Drivers/USB/Class/Device/CDC.c
View file @
03130342
...
...
@@ -257,13 +257,13 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
Endpoint_ClearIN
();
}
void
CDC_Device_CreateStream
(
USB_ClassInfo_CDC_Device_t
*
CDCInterfaceInfo
,
FILE
*
Stream
)
void
CDC_Device_CreateStream
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
,
FILE
*
const
Stream
)
{
*
Stream
=
(
FILE
)
FDEV_SETUP_STREAM
(
CDC_Device_putchar
,
CDC_Device_getchar
,
_FDEV_SETUP_RW
);
fdev_set_udata
(
Stream
,
CDCInterfaceInfo
);
}
void
CDC_Device_CreateBlockingStream
(
USB_ClassInfo_CDC_Device_t
*
CDCInterfaceInfo
,
FILE
*
Stream
)
void
CDC_Device_CreateBlockingStream
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
,
FILE
*
const
Stream
)
{
*
Stream
=
(
FILE
)
FDEV_SETUP_STREAM
(
CDC_Device_putchar
,
CDC_Device_getchar_Blocking
,
_FDEV_SETUP_RW
);
fdev_set_udata
(
Stream
,
CDCInterfaceInfo
);
...
...
LUFA/Drivers/USB/Class/Device/CDC.h
View file @
03130342
...
...
@@ -196,7 +196,7 @@
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
* \param[in] Duration Duration of the break that has been sent by the host, in milliseconds.
*/
void
EVENT_CDC_Device_BreakSent
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
,
uint8_t
Duration
)
ATTR_NON_NULL_PTR_ARG
(
1
);
void
EVENT_CDC_Device_BreakSent
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
,
const
uint8_t
Duration
)
ATTR_NON_NULL_PTR_ARG
(
1
);
/** Sends a given string to the attached USB host, if connected. If a host is not connected when the function is called, the
* string is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the
...
...
@@ -292,7 +292,7 @@
* \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
*
const
CDCInterfaceInfo
,
FILE
*
const
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
...
...
@@ -301,7 +301,7 @@
* \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
*
const
CDCInterfaceInfo
,
FILE
*
const
Stream
)
ATTR_NON_NULL_PTR_ARG
(
1
)
ATTR_NON_NULL_PTR_ARG
(
2
);
/* Private Interface - For use in library only: */
...
...
@@ -317,7 +317,7 @@
ATTR_WEAK
ATTR_NON_NULL_PTR_ARG
(
1
)
ATTR_ALIAS
(
CDC_Device_Event_Stub
);
void
EVENT_CDC_Device_ControLineStateChanged
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
)
ATTR_WEAK
ATTR_NON_NULL_PTR_ARG
(
1
)
ATTR_ALIAS
(
CDC_Device_Event_Stub
);
void
EVENT_CDC_Device_BreakSent
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
,
uint8_t
Duration
)
void
EVENT_CDC_Device_BreakSent
(
USB_ClassInfo_CDC_Device_t
*
const
CDCInterfaceInfo
,
const
uint8_t
Duration
)
ATTR_WEAK
ATTR_NON_NULL_PTR_ARG
(
1
)
ATTR_ALIAS
(
CDC_Device_Event_Stub
);
#endif
...
...
LUFA/Drivers/USB/Class/Device/HID.h
View file @
03130342
...
...
@@ -132,21 +132,21 @@
*
* \return Boolean true if the endpoints were successfully configured, false otherwise.
*/
bool
HID_Device_ConfigureEndpoints
(
USB_ClassInfo_HID_Device_t
*
HIDInterfaceInfo
)
ATTR_NON_NULL_PTR_ARG
(
1
);
bool
HID_Device_ConfigureEndpoints
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
)
ATTR_NON_NULL_PTR_ARG
(
1
);
/** Processes incoming control requests from the host, that are directed to the given HID class interface. This should be
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
*/
void
HID_Device_ProcessControlRequest
(
USB_ClassInfo_HID_Device_t
*
HIDInterfaceInfo
)
ATTR_NON_NULL_PTR_ARG
(
1
);
void
HID_Device_ProcessControlRequest
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
)
ATTR_NON_NULL_PTR_ARG
(
1
);
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
*/
void
HID_Device_USBTask
(
USB_ClassInfo_HID_Device_t
*
HIDInterfaceInfo
)
ATTR_NON_NULL_PTR_ARG
(
1
);
void
HID_Device_USBTask
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
)
ATTR_NON_NULL_PTR_ARG
(
1
);
/** HID class driver callback for the user creation of a HID IN report. This callback may fire in response to either
* HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the
...
...
@@ -164,7 +164,7 @@
* the idle period (useful for devices which report relative movement), false otherwise.
*/
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
)
ATTR_NON_NULL_PTR_ARG
(
1
)
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
const
ReportSize
)
ATTR_NON_NULL_PTR_ARG
(
1
)
ATTR_NON_NULL_PTR_ARG
(
2
)
ATTR_NON_NULL_PTR_ARG
(
4
)
ATTR_NON_NULL_PTR_ARG
(
5
);
/** HID class driver callback for the user processing of a received HID OUT report. This callback may fire in response to
...
...
@@ -190,8 +190,8 @@
*
* \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
)
ATTR_ALWAYS_INLINE
ATTR_NON_NULL_PTR_ARG
(
1
);
static
inline
void
HID_Device_MillisecondElapsed
(
USB_ClassInfo_HID_Device_t
*
HIDInterfaceInfo
)
static
inline
void
HID_Device_MillisecondElapsed
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
)
ATTR_ALWAYS_INLINE
ATTR_NON_NULL_PTR_ARG
(
1
);
static
inline
void
HID_Device_MillisecondElapsed
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
)
{
if
(
HIDInterfaceInfo
->
State
.
IdleMSRemaining
)
HIDInterfaceInfo
->
State
.
IdleMSRemaining
--
;
...
...
LUFA/Drivers/USB/Class/Device/MIDI.c
View file @
03130342
...
...
@@ -62,7 +62,7 @@ bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInter
return
true
;
}
uint8_t
MIDI_Device_SendEventPacket
(
USB_ClassInfo_MIDI_Device_t
*
const
MIDIInterfaceInfo
,
MIDI_EventPacket_t
*
const
Event
)
uint8_t
MIDI_Device_SendEventPacket
(
USB_ClassInfo_MIDI_Device_t
*
const
MIDIInterfaceInfo
,
const
MIDI_EventPacket_t
*
const
Event
)
{
if
(
USB_DeviceState
!=
DEVICE_STATE_Configured
)
return
ENDPOINT_RWSTREAM_DeviceDisconnected
;
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment