@@ -144,8 +144,7 @@ static st_fifo_out_slot gyr_slot[SLOT_NUMBER];
144144 * and are strictly related to the hardware platform used.
145145 *
146146 */
147- static int32_t platform_write (void * handle , uint8_t reg ,
148- uint8_t * bufp ,
147+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
149148 uint16_t len );
150149static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
151150 uint16_t len );
@@ -307,20 +306,19 @@ void lsm6dsr_compressed_fifo(void)
307306 * @param len number of consecutive register to write
308307 *
309308 */
310- static int32_t platform_write (void * handle , uint8_t reg ,
311- uint8_t * bufp ,
309+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
312310 uint16_t len )
313311{
314312#if defined(NUCLEO_F411RE )
315313 HAL_I2C_Mem_Write (handle , LSM6DSR_I2C_ADD_L , reg ,
316- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
314+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
317315#elif defined(STEVAL_MKI109V3 )
318316 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
319317 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
320- HAL_SPI_Transmit (handle , bufp , len , 1000 );
318+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
321319 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
322320#elif defined(SPC584B_DIS )
323- i2c_lld_write (handle , LSM6DSR_I2C_ADD_L & 0xFE , reg , bufp , len );
321+ i2c_lld_write (handle , LSM6DSR_I2C_ADD_L & 0xFE , reg , ( uint8_t * ) bufp , len );
324322#endif
325323 return 0 ;
326324}
0 commit comments