Skip to content

Commit cfe7a8f

Browse files
author
albezanc
committed
stts751: added const to stmdev_write_ptr #121
1 parent ad53bdf commit cfe7a8f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

stts751_STdC/driver

stts751_STdC/examples/stts751_read_data_polling.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ static uint8_t tx_buffer[1000];
9696
* and are strictly related to the hardware platform used.
9797
*
9898
*/
99-
static int32_t platform_write(void *handle, uint8_t reg,
100-
uint8_t *bufp,
99+
static int32_t platform_write(void *handle, uint8_t reg, const uint8_t *bufp,
101100
uint16_t len);
102101
static int32_t platform_read(void *handle, uint8_t reg, uint8_t *bufp,
103102
uint16_t len);
@@ -166,15 +165,15 @@ void stts751_read_data_polling(void)
166165
* @param len number of consecutive register to write
167166
*
168167
*/
169-
static int32_t platform_write(void *handle, uint8_t reg,
170-
uint8_t *bufp,
168+
static int32_t platform_write(void *handle, uint8_t reg, const uint8_t *bufp,
171169
uint16_t len)
172170
{
173171
#if defined(NUCLEO_F411RE)
174172
HAL_I2C_Mem_Write(handle, STTS751_0xxxx_ADD_7K5, reg,
175-
I2C_MEMADD_SIZE_8BIT, bufp, len, 1000);
173+
I2C_MEMADD_SIZE_8BIT, (uint8_t*) bufp, len, 1000);
176174
#elif defined(SPC584B_DIS)
177-
i2c_lld_write(handle, STTS751_0xxxx_ADD_7K5 & 0xFE, reg, bufp, len);
175+
i2c_lld_write(handle, STTS751_0xxxx_ADD_7K5 & 0xFE, reg,
176+
(uint8_t*) bufp, len);
178177
#endif
179178
return 0;
180179
}

0 commit comments

Comments
 (0)