diff --git a/fw/lib_i2c.c b/fw/lib_i2c.c index 521225b..1275d60 100644 --- a/fw/lib_i2c.c +++ b/fw/lib_i2c.c @@ -86,7 +86,7 @@ void i2c_scan(I2C_TypeDef* I2Cx, void (*onPingFound)(u8 address)) { //! I2C SEND FUNCTION //! #################################### -u8 i2c_sendBytes_noStop(I2C_TypeDef* I2Cx, u8 i2cAddress, u8* buffer, u8 len) { +u8 i2c_sendBytes_noStop(I2C_TypeDef* I2Cx, u8 i2cAddress, const u8* buffer, u8 len) { u8 err = i2c_start(I2Cx, i2cAddress, 0); // Write mode if (err) return err; u32 timeout; @@ -107,7 +107,7 @@ u8 i2c_sendBytes_noStop(I2C_TypeDef* I2Cx, u8 i2cAddress, u8* buffer, u8 len) { return 0; } -u8 i2c_sendBytes(I2C_TypeDef* I2Cx, u8 i2cAddress, u8* buffer, u8 len) { +u8 i2c_sendBytes(I2C_TypeDef* I2Cx, u8 i2cAddress, const u8* buffer, u8 len) { u8 err = i2c_sendBytes_noStop(I2Cx, i2cAddress, buffer, len); //# Generate STOP condition I2Cx->CTLR1 |= I2C_CTLR1_STOP; diff --git a/fw/lib_i2c.h b/fw/lib_i2c.h index 4b4aa16..f5b0e2b 100644 --- a/fw/lib_i2c.h +++ b/fw/lib_i2c.h @@ -23,8 +23,8 @@ void i2c_scan(I2C_TypeDef* I2Cx, void (*onPingFound)(u8 address)); //! I2C SEND FUNCTION //! #################################### -u8 i2c_sendBytes_noStop(I2C_TypeDef* I2Cx, u8 i2cAddress, u8* buffer, u8 len); -u8 i2c_sendBytes(I2C_TypeDef* I2Cx, u8 i2cAddress, u8* buffer, u8 len); +u8 i2c_sendBytes_noStop(I2C_TypeDef* I2Cx, u8 i2cAddress, const u8* buffer, u8 len); +u8 i2c_sendBytes(I2C_TypeDef* I2Cx, u8 i2cAddress, const u8* buffer, u8 len); u8 i2c_sendByte(I2C_TypeDef* I2Cx, u8 i2cAddress, u8 data); //! ####################################