aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/CCID
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/LowLevel/CCID
parent8e590e6cb3013ab3e317e219031b326df16fb6dc (diff)
downloadlufa-bc57f4ea5afd29f2e0f0175d14cf1540b4408de8.tar.gz
lufa-bc57f4ea5afd29f2e0f0175d14cf1540b4408de8.tar.bz2
lufa-bc57f4ea5afd29f2e0f0175d14cf1540b4408de8.zip
Reformatting and add const qualifiers.
Diffstat (limited to 'Demos/Device/LowLevel/CCID')
-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
4 files changed, 24 insertions, 14 deletions
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