@@ -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 );
@@ -294,20 +293,19 @@ void example_compressed_fifo_simple_lsm6dso(void)
294293 * @param len number of consecutive register to write
295294 *
296295 */
297- static int32_t platform_write (void * handle , uint8_t reg ,
298- uint8_t * bufp ,
296+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
299297 uint16_t len )
300298{
301299#if defined(NUCLEO_F411RE )
302300 HAL_I2C_Mem_Write (handle , LSM6DSO_I2C_ADD_L , reg ,
303- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
301+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
304302#elif defined(STEVAL_MKI109V3 )
305303 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
306304 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
307- HAL_SPI_Transmit (handle , bufp , len , 1000 );
305+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
308306 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
309307#elif defined(SPC584B_DIS )
310- i2c_lld_write (handle , LSM6DSO_I2C_ADD_H & 0xFE , reg , bufp , len );
308+ i2c_lld_write (handle , LSM6DSO_I2C_ADD_H & 0xFE , reg , ( uint8_t * ) bufp , len );
311309#endif
312310 return 0 ;
313311}
0 commit comments