Commit f469eb77 authored by Dean Camera's avatar Dean Camera
Browse files

Add const qualifiers to class driver callback parameters, fix parameter naming.

parent 2a057a72
......@@ -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)
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
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