From 8af8723528847596b0f3979cf4f1c0a36216bee7 Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Mon, 14 Aug 2023 21:45:21 -0700 Subject: [PATCH] const for `i2c` --- armsrc/i2c.c | 6 +++--- armsrc/i2c.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/armsrc/i2c.c b/armsrc/i2c.c index ca3cb46fd..016ae2f13 100644 --- a/armsrc/i2c.c +++ b/armsrc/i2c.c @@ -407,7 +407,7 @@ bool I2C_WriteByte(uint8_t data, uint8_t device_cmd, uint8_t device_address) { //Sends array of data (Array, length, command to be written , SlaveDevice address ). // len = uint16 because we need to write up to 256 bytes -bool I2C_BufferWrite(uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t device_address) { +bool I2C_BufferWrite(const uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t device_address) { bool bBreak = true; do { if (!I2C_Start()) @@ -602,7 +602,7 @@ int16_t I2C_ReadFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t return readcount; } -bool I2C_WriteFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t device_address) { +bool I2C_WriteFW(const uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t device_address) { //START, 0xB0, 0x00, 0x00, xx, yy, zz, ......, STOP bool bBreak = true; @@ -772,7 +772,7 @@ void SmartCardAtr(void) { // StopTicks(); } -void SmartCardRaw(smart_card_raw_t *p) { +void SmartCardRaw(const smart_card_raw_t *p) { LED_D_ON(); uint16_t len = 0; diff --git a/armsrc/i2c.h b/armsrc/i2c.h index 972704c1b..6fa8b8809 100644 --- a/armsrc/i2c.h +++ b/armsrc/i2c.h @@ -41,12 +41,12 @@ void I2C_Reset_EnterBootloader(void); bool I2C_WriteCmd(uint8_t device_cmd, uint8_t device_address); bool I2C_WriteByte(uint8_t data, uint8_t device_cmd, uint8_t device_address); -bool I2C_BufferWrite(uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t device_address); +bool I2C_BufferWrite(const uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t device_address); int16_t I2C_BufferRead(uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t device_address); // for firmware int16_t I2C_ReadFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t device_address); -bool I2C_WriteFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t device_address); +bool I2C_WriteFW(const uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t device_address); bool sc_rx_bytes(uint8_t *dest, uint16_t *destlen); // @@ -54,7 +54,7 @@ bool GetATR(smart_card_atr_t *card_ptr, bool verbose); // generice functions void SmartCardAtr(void); -void SmartCardRaw(smart_card_raw_t *p); +void SmartCardRaw(const smart_card_raw_t *p); void SmartCardUpgrade(uint64_t arg0); void SmartCardSetBaud(uint64_t arg0); void SmartCardSetClock(uint64_t arg0);