@@ -128,8 +128,7 @@ static st_fifo_out_slot gyr_slot[SLOT_NUMBER];
128128 * and are strictly related to the hardware platform used.
129129 *
130130 */
131- static int32_t platform_write (void * handle , uint8_t reg ,
132- uint8_t * bufp ,
131+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
133132 uint16_t len );
134133static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
135134 uint16_t len );
@@ -295,20 +294,19 @@ void lsm6dsox_compressed_fifo(void)
295294 * @param len number of consecutive register to write
296295 *
297296 */
298- static int32_t platform_write (void * handle , uint8_t reg ,
299- uint8_t * bufp ,
297+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
300298 uint16_t len )
301299{
302300#if defined(NUCLEO_F411RE )
303301 HAL_I2C_Mem_Write (handle , LSM6DSOX_I2C_ADD_L , reg ,
304- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
302+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
305303#elif defined(STEVAL_MKI109V3 )
306304 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
307305 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
308- HAL_SPI_Transmit (handle , bufp , len , 1000 );
306+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
309307 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
310308#elif defined(SPC584B_DIS )
311- i2c_lld_write (handle , LSM6DSOX_I2C_ADD_L & 0xFE , reg , bufp , len );
309+ i2c_lld_write (handle , LSM6DSOX_I2C_ADD_L & 0xFE , reg , ( uint8_t * ) bufp , len );
312310#endif
313311 return 0 ;
314312}
0 commit comments