Skip to content

Commit

Permalink
stts22h: added const to stmdev_write_ptr #121
Browse files Browse the repository at this point in the history
  • Loading branch information
albezanc committed May 21, 2021
1 parent 826cff1 commit ad53bdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion stts22h_STdC/driver
10 changes: 4 additions & 6 deletions stts22h_STdC/examples/stts22h_read_data_polling.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ static uint8_t tx_buffer[1000];
* and are strictly related to the hardware platform used.
*
*/
static int32_t platform_write(void *handle, uint8_t reg,
uint8_t *bufp,
static int32_t platform_write(void *handle, uint8_t reg, const uint8_t *bufp,
uint16_t len);
static int32_t platform_read(void *handle, uint8_t reg, uint8_t *bufp,
uint16_t len);
Expand Down Expand Up @@ -166,15 +165,14 @@ void stts22h_read_data_polling(void)
* @param len number of consecutive register to write
*
*/
static int32_t platform_write(void *handle, uint8_t reg,
uint8_t *bufp,
static int32_t platform_write(void *handle, uint8_t reg, const uint8_t *bufp,
uint16_t len)
{
#if defined(NUCLEO_F411RE)
HAL_I2C_Mem_Write(handle, STTS22H_I2C_ADD_H, reg,
I2C_MEMADD_SIZE_8BIT, bufp, len, 1000);
I2C_MEMADD_SIZE_8BIT, (uint8_t*) bufp, len, 1000);
#elif defined(SPC584B_DIS)
i2c_lld_write(handle, STTS22H_I2C_ADD_H & 0xFE, reg, bufp, len);
i2c_lld_write(handle, STTS22H_I2C_ADD_H & 0xFE, reg, (uint8_t*) bufp, len);
#endif
return 0;
}
Expand Down

0 comments on commit ad53bdf

Please sign in to comment.