@@ -121,8 +121,7 @@ static uint8_t tx_buffer[TX_BUF_DIM];
121121 * and are strictly related to the hardware platform used.
122122 *
123123 */
124- static int32_t platform_write (void * handle , uint8_t reg ,
125- uint8_t * bufp ,
124+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
126125 uint16_t len );
127126static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
128127 uint16_t len );
@@ -239,20 +238,19 @@ void lsm6dsl_read_data_polling(void)
239238 * @param len number of consecutive register to write
240239 *
241240 */
242- static int32_t platform_write (void * handle , uint8_t reg ,
243- uint8_t * bufp ,
241+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
244242 uint16_t len )
245243{
246244#if defined(NUCLEO_F411RE )
247245 HAL_I2C_Mem_Write (handle , LSM6DSL_I2C_ADD_H , reg ,
248- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
246+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
249247#elif defined(STEVAL_MKI109V3 )
250248 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
251249 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
252- HAL_SPI_Transmit (handle , bufp , len , 1000 );
250+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
253251 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
254252#elif defined(SPC584B_DIS )
255- i2c_lld_write (handle , LSM6DSL_I2C_ADD_H & 0xFE , reg , bufp , len );
253+ i2c_lld_write (handle , LSM6DSL_I2C_ADD_H & 0xFE , reg , ( uint8_t * ) bufp , len );
256254#endif
257255 return 0 ;
258256}
0 commit comments