@@ -124,8 +124,7 @@ static uint8_t tx_buffer[1000];
124124 * and are strictly related to the hardware platform used.
125125 *
126126 */
127- static int32_t platform_write (void * handle , uint8_t reg ,
128- uint8_t * bufp ,
127+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
129128 uint16_t len );
130129static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
131130 uint16_t len );
@@ -254,20 +253,19 @@ void example_multi_read_fifo_simple_lsm6ds3(void)
254253 * @param len number of consecutive register to write
255254 *
256255 */
257- static int32_t platform_write (void * handle , uint8_t reg ,
258- uint8_t * bufp ,
256+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
259257 uint16_t len )
260258{
261259#if defined(NUCLEO_F411RE )
262260 HAL_I2C_Mem_Write (handle , LSM6DS3_I2C_ADD_L , reg ,
263- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
261+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
264262#elif defined(STEVAL_MKI109V3 )
265263 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
266264 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
267- HAL_SPI_Transmit (handle , bufp , len , 1000 );
265+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
268266 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
269267#elif defined(SPC584B_DIS )
270- i2c_lld_write (handle , LSM6DS3_I2C_ADD_L & 0xFE , reg , bufp , len );
268+ i2c_lld_write (handle , LSM6DS3_I2C_ADD_L & 0xFE , reg , ( uint8_t * ) bufp , len );
271269#endif
272270 return 0 ;
273271}
0 commit comments