aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2018-06-24 16:41:58 +1000
committerDean Camera <dean@fourwalledcubicle.com>2018-06-24 16:41:58 +1000
commitbc57f4ea5afd29f2e0f0175d14cf1540b4408de8 (patch)
tree1d393db9904884112e42b80017a04a777449b80f /Demos/Device
parent8e590e6cb3013ab3e317e219031b326df16fb6dc (diff)
downloadlufa-bc57f4ea5afd29f2e0f0175d14cf1540b4408de8.tar.gz
lufa-bc57f4ea5afd29f2e0f0175d14cf1540b4408de8.tar.bz2
lufa-bc57f4ea5afd29f2e0f0175d14cf1540b4408de8.zip
Reformatting and add const qualifiers.
Diffstat (limited to 'Demos/Device')
-rw-r--r--Demos/Device/ClassDriver/CCID/CCID.c22
-rw-r--r--Demos/Device/ClassDriver/CCID/CCID.h25
-rw-r--r--Demos/Device/ClassDriver/CCID/Lib/Iso7816.c4
-rw-r--r--Demos/Device/ClassDriver/CCID/Lib/Iso7816.h4
-rw-r--r--Demos/Device/LowLevel/CCID/CCID.c14
-rw-r--r--Demos/Device/LowLevel/CCID/CCID.h17
-rw-r--r--Demos/Device/LowLevel/CCID/Lib/Iso7816.c3
-rw-r--r--Demos/Device/LowLevel/CCID/Lib/Iso7816.h4
8 files changed, 59 insertions, 34 deletions
diff --git a/Demos/Device/ClassDriver/CCID/CCID.c b/Demos/Device/ClassDriver/CCID/CCID.c
index 916306505..9059ad40d 100644
--- a/Demos/Device/ClassDriver/CCID/CCID.c
+++ b/Demos/Device/ClassDriver/CCID/CCID.c
@@ -157,10 +157,11 @@ void EVENT_USB_Device_ControlRequest(void)
* whenever an application at the host wants to send a power off signal to a slot.
* THe slot must reply back with a recognizable ATR (answer to reset)
*/
-uint8_t CALLBACK_CCID_IccPowerOn(uint8_t slot,
- uint8_t* atr,
- uint8_t* attrSize,
- uint8_t* error)
+uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
+ uint8_t slot,
+ uint8_t* const atr,
+ uint8_t* const attrSize,
+ uint8_t* const error)
{
if (slot < CCID_Interface.Config.TotalSlots)
{
@@ -176,7 +177,9 @@ uint8_t CALLBACK_CCID_IccPowerOn(uint8_t slot,
/** Event handler for the CCID_PC_to_RDR_IccPowerOff message. This message is sent to the device
* whenever an application at the host wants to send a power off signal to a slot.
*/
-uint8_t CALLBACK_CCID_IccPowerOff(uint8_t slot, uint8_t* error)
+uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
+ uint8_t slot,
+ uint8_t* const error)
{
if (slot < CCID_Interface.Config.TotalSlots)
{
@@ -194,7 +197,9 @@ uint8_t CALLBACK_CCID_IccPowerOff(uint8_t slot, uint8_t* error)
* whenever an application at the host wants to the get the current slot status
*
*/
-uint8_t CALLBACK_CCID_GetSlotStatus(uint8_t slot, uint8_t* error)
+uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
+ uint8_t slot,
+ uint8_t* const error)
{
if (slot < CCID_Interface.Config.TotalSlots)
{
@@ -208,9 +213,10 @@ uint8_t CALLBACK_CCID_GetSlotStatus(uint8_t slot, uint8_t* error)
}
}
-uint8_t CALLBACK_CCID_Abort(uint8_t slot,
+uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
+ uint8_t slot,
uint8_t seq,
- uint8_t* error)
+ 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 608fb7801..f6dd4adf5 100644
--- a/Demos/Device/ClassDriver/CCID/CCID.h
+++ b/Demos/Device/ClassDriver/CCID/CCID.h
@@ -75,16 +75,21 @@
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
- uint8_t CALLBACK_CCID_IccPowerOn(uint8_t slot,
- uint8_t* atr,
- uint8_t* atrSize,
- uint8_t* error);
- uint8_t CALLBACK_CCID_IccPowerOff(uint8_t slot, uint8_t* error);
- uint8_t CALLBACK_CCID_GetSlotStatus(uint8_t slot, uint8_t* error);
- uint8_t CALLBACK_CCID_Abort(uint8_t slot,
- uint8_t seq,
- uint8_t *error);
-
+ 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);
+ uint8_t CALLBACK_CCID_IccPowerOff(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
+ 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);
+ uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,
+ uint8_t slot,
+ uint8_t seq,
+ uint8_t* const error);
#endif
diff --git a/Demos/Device/ClassDriver/CCID/Lib/Iso7816.c b/Demos/Device/ClassDriver/CCID/Lib/Iso7816.c
index 1f9391d72..ec6e1f323 100644
--- a/Demos/Device/ClassDriver/CCID/Lib/Iso7816.c
+++ b/Demos/Device/ClassDriver/CCID/Lib/Iso7816.c
@@ -31,7 +31,9 @@
#include "Iso7816.h"
-void Iso7816_CreateSimpleAtr(uint8_t* attr, uint8_t* attrLength)
+
+void Iso7816_CreateSimpleAtr(uint8_t* const attr,
+ uint8_t* const attrLength)
{
attr[0] = 0x3B; //TS: direct convention
diff --git a/Demos/Device/ClassDriver/CCID/Lib/Iso7816.h b/Demos/Device/ClassDriver/CCID/Lib/Iso7816.h
index f5fc1d70a..2a5570629 100644
--- a/Demos/Device/ClassDriver/CCID/Lib/Iso7816.h
+++ b/Demos/Device/ClassDriver/CCID/Lib/Iso7816.h
@@ -36,7 +36,9 @@
#include <avr/power.h>
#include <avr/interrupt.h>
#include <stdlib.h>
+ #include <string.h>
/* Function Prototypes: */
- void Iso7816_CreateSimpleAtr(uint8_t* attr, uint8_t* attrLength);
+ void Iso7816_CreateSimpleAtr(uint8_t* const attr,
+ uint8_t* const attrLength);
#endif
diff --git a/Demos/Device/LowLevel/CCID/CCID.c b/Demos/Device/LowLevel/CCID/CCID.c
index 8b46e89be..764392de0 100644
--- a/Demos/Device/LowLevel/CCID/CCID.c
+++ b/Demos/Device/LowLevel/CCID/CCID.c
@@ -197,9 +197,9 @@ void EVENT_USB_Device_ControlRequest(void)
* THe slot must reply back with a recognizable ATR (answer to reset)
*/
uint8_t CCID_IccPowerOn(uint8_t slot,
- uint8_t* atr,
- uint8_t* atrLength,
- uint8_t* error)
+ uint8_t* const atr,
+ uint8_t* const atrLength,
+ uint8_t* const error)
{
if (slot == 0)
{
@@ -219,7 +219,7 @@ uint8_t CCID_IccPowerOn(uint8_t slot,
* whenever an application at the host wants to send a power off signal to a slot.
*/
uint8_t CCID_IccPowerOff(uint8_t slot,
- uint8_t* error)
+ uint8_t* const error)
{
if (slot == 0)
{
@@ -238,7 +238,7 @@ uint8_t CCID_IccPowerOff(uint8_t slot,
* slot status.
*/
uint8_t CCID_GetSlotStatus(uint8_t slot,
- uint8_t* error)
+ uint8_t* const error)
{
if (slot == 0)
{
@@ -258,7 +258,7 @@ uint8_t CCID_GetSlotStatus(uint8_t slot,
*/
uint8_t CCID_Abort(uint8_t slot,
uint8_t seq,
- uint8_t* error)
+ uint8_t* const error)
{
if (Aborted && slot == 0 && AbortedSeq == seq)
{
@@ -283,7 +283,7 @@ uint8_t CCID_Abort(uint8_t slot,
}
/** Gets and status and verifies whether an error occurred. */
-bool CCID_CheckStatusNoError(int status)
+bool CCID_CheckStatusNoError(uint8_t status)
{
return (status & 0xC0) == 0x0;
}
diff --git a/Demos/Device/LowLevel/CCID/CCID.h b/Demos/Device/LowLevel/CCID/CCID.h
index 77bedcf0e..d4503597b 100644
--- a/Demos/Device/LowLevel/CCID/CCID.h
+++ b/Demos/Device/LowLevel/CCID/CCID.h
@@ -72,11 +72,18 @@
void SetupHardware(void);
void CCID_Task(void);
- uint8_t CCID_IccPowerOn(uint8_t slot, uint8_t* attr, uint8_t* attrLength, uint8_t* error);
- uint8_t CCID_IccPowerOff(uint8_t slot, uint8_t* error);
- uint8_t CCID_GetSlotStatus(uint8_t slot, uint8_t* error);
- uint8_t CCID_Abort(uint8_t slot, uint8_t seq, uint8_t* error);
- bool CCID_CheckStatusNoError(int 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/Demos/Device/LowLevel/CCID/Lib/Iso7816.c b/Demos/Device/LowLevel/CCID/Lib/Iso7816.c
index 0c2e5e8b0..138c5b65f 100644
--- a/Demos/Device/LowLevel/CCID/Lib/Iso7816.c
+++ b/Demos/Device/LowLevel/CCID/Lib/Iso7816.c
@@ -31,7 +31,8 @@
#include "Iso7816.h"
-void Iso7816_CreateSimpleAtr(uint8_t* atr, uint8_t* atrLength)
+void Iso7816_CreateSimpleAtr(uint8_t* const atr,
+ uint8_t* const atrLength)
{
atr[0] = 0x3B; // TS: direct convention
diff --git a/Demos/Device/LowLevel/CCID/Lib/Iso7816.h b/Demos/Device/LowLevel/CCID/Lib/Iso7816.h
index aa5f4ba83..f73309d90 100644
--- a/Demos/Device/LowLevel/CCID/Lib/Iso7816.h
+++ b/Demos/Device/LowLevel/CCID/Lib/Iso7816.h
@@ -38,8 +38,10 @@
#include <avr/power.h>
#include <avr/interrupt.h>
#include <stdlib.h>
+ #include <string.h>
/* Function Prototypes: */
- void Iso7816_CreateSimpleAtr(uint8_t* atr, uint8_t* atrLength);
+ void Iso7816_CreateSimpleAtr(uint8_t* const atr,
+ uint8_t* const atrLength);
#endif