From 5e71621c692784ec99abd0612b8ac9db1d9cc46c Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Tue, 8 Aug 2023 20:52:21 -0700 Subject: [PATCH] `const` improvement for BigBuf.h --- armsrc/BigBuf.c | 6 +++--- armsrc/BigBuf.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/armsrc/BigBuf.c b/armsrc/BigBuf.c index 29f270b80..b622e013b 100644 --- a/armsrc/BigBuf.c +++ b/armsrc/BigBuf.c @@ -233,7 +233,7 @@ uint32_t BigBuf_get_traceLen(void) { by 'hf list -t raw', alternatively 'hf list -t ' for protocol-specific annotation of commands/responses. **/ -bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool reader2tag) { +bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, const uint8_t *parity, bool reader2tag) { if (tracing == false) { return false; } @@ -290,7 +290,7 @@ bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_ } // specific LogTrace function for ISO15693: the duration needs to be scaled because otherwise it won't fit into a uint16_t -bool LogTrace_ISO15693(const uint8_t *bytes, uint16_t len, uint32_t ts_start, uint32_t ts_end, uint8_t *parity, bool reader2tag) { +bool LogTrace_ISO15693(const uint8_t *bytes, uint16_t len, uint32_t ts_start, uint32_t ts_end, const uint8_t *parity, bool reader2tag) { uint32_t duration = ts_end - ts_start; duration /= 32; ts_end = ts_start + duration; @@ -306,7 +306,7 @@ bool RAMFUNC LogTraceBits(const uint8_t *btBytes, uint16_t bitLen, uint32_t time } // Emulator memory -uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length) { +uint8_t emlSet(const uint8_t *data, uint32_t offset, uint32_t length) { uint8_t *mem = BigBuf_get_EM_addr(); if (offset + length <= CARD_MEMORY_SIZE) { memcpy(mem + offset, data, length); diff --git a/armsrc/BigBuf.h b/armsrc/BigBuf.h index 81c2fbdfc..0938bd555 100644 --- a/armsrc/BigBuf.h +++ b/armsrc/BigBuf.h @@ -51,11 +51,11 @@ void set_tracing(bool enable); void set_tracelen(uint32_t value); bool get_tracing(void); -bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool reader2tag); +bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, const uint8_t *parity, bool reader2tag); bool RAMFUNC LogTraceBits(const uint8_t *btBytes, uint16_t bitLen, uint32_t timestamp_start, uint32_t timestamp_end, bool reader2tag); -bool LogTrace_ISO15693(const uint8_t *bytes, uint16_t len, uint32_t ts_start, uint32_t ts_end, uint8_t *parity, bool reader2tag); +bool LogTrace_ISO15693(const uint8_t *bytes, uint16_t len, uint32_t ts_start, uint32_t ts_end, const uint8_t *parity, bool reader2tag); -uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length); +uint8_t emlSet(const uint8_t *data, uint32_t offset, uint32_t length); uint8_t emlGet(uint8_t *out, uint32_t offset, uint32_t length); typedef struct {