aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2018-08-06 20:04:01 +1000
committerDean Camera <dean@fourwalledcubicle.com>2018-08-06 20:04:01 +1000
commitf469eb7745b52029d57636334b2e3f4e511bc968 (patch)
treecfe5f2bc586fd141d416640d08d2e61ceff6fbc3
parent2a057a7209a1a4457306a2bb42894f42a05fffcd (diff)
downloadlufa-f469eb7745b52029d57636334b2e3f4e511bc968.tar.gz
lufa-f469eb7745b52029d57636334b2e3f4e511bc968.tar.bz2
lufa-f469eb7745b52029d57636334b2e3f4e511bc968.zip
Add const qualifiers to class driver callback parameters, fix parameter naming.
-rw-r--r--Demos/Device/ClassDriver/CCID/CCID.c20
-rw-r--r--Demos/Device/ClassDriver/CCID/CCID.h32
-rw-r--r--Demos/Device/LowLevel/CCID/CCID.h24
-rw-r--r--LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h26
4 files changed, 51 insertions, 51 deletions
diff --git a/Demos/Device/ClassDriver/CCID/CCID.c b/Demos/Device/ClassDriver/CCID/CCID.c
index f0dae9129..fa913dafd 100644
--- a/Demos/Device/ClassDriver/CCID/CCID.c
+++ b/Demos/Device/ClassDriver/CCID/CCID.c
@@ -158,7 +158,7 @@ void EVENT_USB_Device_ControlRequest(void)
* THe slot must reply back with a recognizable ATR (answer to reset)
*/
uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
+ const uint8_t slot,
uint8_t* const atr,
uint8_t* const attrSize,
uint8_t* const error)
@@ -180,7 +180,7 @@ uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t* const CCIDInterfac
* whenever an application at the host wants to send a power off signal to a slot.
*/
uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
+ const uint8_t slot,
uint8_t* const error)
{
if (slot < CCID_Interface.Config.TotalSlots)
@@ -200,7 +200,7 @@ uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfa
*
*/
uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
+ const uint8_t slot,
uint8_t* const error)
{
if (slot < CCID_Interface.Config.TotalSlots)
@@ -220,7 +220,7 @@ uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInter
* given slot.
*/
uint8_t CALLBACK_CCID_SetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Error,
USB_CCID_ProtocolData_T0_t* const T0)
{
@@ -244,7 +244,7 @@ uint8_t CALLBACK_CCID_SetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDIn
* a given slot.
*/
uint8_t CALLBACK_CCID_GetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Error,
uint8_t* const ProtocolNum,
USB_CCID_ProtocolData_T0_t* const T0)
@@ -269,9 +269,9 @@ uint8_t CALLBACK_CCID_GetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDIn
* THe device reply back with an array of bytes
*/
uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
- uint8_t* const ReceivedBuffer,
- uint8_t ReceivedBufferSize,
+ const uint8_t Slot,
+ const uint8_t* ReceivedBuffer,
+ const uint8_t ReceivedBufferSize,
uint8_t* const SendBuffer,
uint8_t* const SentBufferSize,
uint8_t* const Error)
@@ -294,8 +294,8 @@ uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceI
}
uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
- uint8_t Seq,
+ const uint8_t Slot,
+ const uint8_t Seq,
uint8_t* const Error)
{
if (CCID_Interface.State.Aborted && Slot == 0 && CCID_Interface.State.AbortedSeq == Seq)
diff --git a/Demos/Device/ClassDriver/CCID/CCID.h b/Demos/Device/ClassDriver/CCID/CCID.h
index 88c29aef1..e3a553058 100644
--- a/Demos/Device/ClassDriver/CCID/CCID.h
+++ b/Demos/Device/ClassDriver/CCID/CCID.h
@@ -76,26 +76,26 @@
void EVENT_USB_Device_ControlRequest(void);
uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
- uint8_t* const atr,
- uint8_t* const atrSize,
- uint8_t* const error);
+ const uint8_t Slot,
+ uint8_t* const Atr,
+ uint8_t* const AtrSize,
+ uint8_t* const Error);
uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
- uint8_t* const error);
+ const uint8_t Slot,
+ uint8_t* const Error);
uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
- uint8_t* const error);
+ const uint8_t Slot,
+ uint8_t* const Error);
uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
- uint8_t* const receivedBuffer,
- uint8_t receivedBufferSize,
- uint8_t* const sendBuffer,
- uint8_t* const sentBufferSize,
- uint8_t* const error);
+ const uint8_t Slot,
+ const uint8_t* ReceivedBuffer,
+ const uint8_t ReceivedBufferSize,
+ uint8_t* const SendBuffer,
+ uint8_t* const SentBufferSize,
+ uint8_t* const Error);
uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t slot,
- uint8_t seq,
+ const uint8_t Slot,
+ const uint8_t Seq,
uint8_t* const error);
#endif
diff --git a/Demos/Device/LowLevel/CCID/CCID.h b/Demos/Device/LowLevel/CCID/CCID.h
index d4503597b..46c759c30 100644
--- a/Demos/Device/LowLevel/CCID/CCID.h
+++ b/Demos/Device/LowLevel/CCID/CCID.h
@@ -72,18 +72,18 @@
void SetupHardware(void);
void CCID_Task(void);
- uint8_t CCID_IccPowerOn(uint8_t slot,
- uint8_t* const attr,
- uint8_t* const attrLength,
- uint8_t* const error);
- uint8_t CCID_IccPowerOff(uint8_t slot,
- uint8_t* const error);
- uint8_t CCID_GetSlotStatus(uint8_t slot,
- uint8_t* const error);
- uint8_t CCID_Abort(uint8_t slot,
- uint8_t seq,
- uint8_t* const error);
- bool CCID_CheckStatusNoError(uint8_t status);
+ uint8_t CCID_IccPowerOn(uint8_t Slot,
+ uint8_t* const Attr,
+ uint8_t* const AttrLength,
+ uint8_t* const Error);
+ uint8_t CCID_IccPowerOff(uint8_t Slot,
+ uint8_t* const Error);
+ uint8_t CCID_GetSlotStatus(uint8_t Slot,
+ uint8_t* const Error);
+ uint8_t CCID_Abort(uint8_t Slot,
+ uint8_t Seq,
+ uint8_t* const Error);
+ bool CCID_CheckStatusNoError(uint8_t Status);
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
diff --git a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h
index 05f487fa2..e29ccef08 100644
--- a/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/CCIDClassDevice.h
@@ -125,7 +125,7 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Atr,
uint8_t* const AtrSize,
uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1);
@@ -140,7 +140,7 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1);
/** CCID class driver callback for PC_TO_RDR_GetSlotStatus CCID message
@@ -153,7 +153,7 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1);
@@ -168,9 +168,9 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_SetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Error,
- USB_CCID_ProtocolData_T0_t* const T0);
+ USB_CCID_ProtocolData_T0_t* const T0) ATTR_NON_NULL_PTR_ARG(1);
/** CCID class driver callback for PC_TO_RDR_SetParameters CCID message for T=0
* Retrieves the current parameters of a given slot
@@ -183,10 +183,10 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_GetParameters_T0(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
+ const uint8_t Slot,
uint8_t* const Error,
uint8_t* const ProtocolNum,
- USB_CCID_ProtocolData_T0_t* const T0);
+ USB_CCID_ProtocolData_T0_t* const T0) ATTR_NON_NULL_PTR_ARG(1);
/** CCID class driver callback for PC_TO_RDR_XfrBlock CCID message
* Send a block of bytes from the host to a slot in the device
@@ -203,12 +203,12 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
- uint8_t* const ReceivedBuffer,
- uint8_t ReceivedBufferSize,
+ const uint8_t Slot,
+ const uint8_t* ReceivedBuffer,
+ const uint8_t ReceivedBufferSize,
uint8_t* const SendBuffer,
uint8_t* const SentBufferSize,
- uint8_t* const Error);
+ uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1);
/** CCID class driver callback for CCID_PC_to_RDR_Abort CCID message
* Aborts a BULK out message previously sent to a slot
@@ -222,8 +222,8 @@
* \return The command result code.
*/
uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
- uint8_t Slot,
- uint8_t Seq,
+ const uint8_t Slot,
+ const uint8_t Seq,
uint8_t* const Error) ATTR_NON_NULL_PTR_ARG(1);