make CRCA checking const-correct

This commit is contained in:
dev-zzo
2016-10-16 13:40:50 +02:00
parent bca913ca91
commit 3c99fefb6b
2 changed files with 5 additions and 5 deletions
@@ -52,9 +52,9 @@ void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount)
#endif
#ifdef USE_HW_CRC
bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount)
bool ISO14443ACheckCRCA(const void* Buffer, uint16_t ByteCount)
{
uint8_t* DataPtr = (uint8_t*) Buffer;
const uint8_t* DataPtr = (const uint8_t*) Buffer;
CRC.CTRL = CRC_RESET0_bm;
CRC.CHECKSUM1 = (CRC_INIT_R >> 8) & 0xFF;
@@ -76,10 +76,10 @@ bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount)
}
#else
#include <util/crc16.h>
bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount)
bool ISO14443ACheckCRCA(const void* Buffer, uint16_t ByteCount)
{
uint16_t Checksum = CRC_INIT;
uint8_t* DataPtr = (uint8_t*) Buffer;
const uint8_t* DataPtr = (const uint8_t*) Buffer;
while(ByteCount--) {
uint8_t Byte = *DataPtr++;
@@ -45,7 +45,7 @@
( ByteBuffer[0] ^ ByteBuffer[1] ^ ByteBuffer[2] ^ ByteBuffer[3] )
void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount);
bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount);
bool ISO14443ACheckCRCA(const void* Buffer, uint16_t ByteCount);
INLINE bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue);
INLINE bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue);