@@ -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 );
@@ -243,20 +242,20 @@ void lsm6ds3tr_c_read_data_polling(void)
243242 * @param len number of consecutive register to write
244243 *
245244 */
246- static int32_t platform_write (void * handle , uint8_t reg ,
247- uint8_t * bufp ,
245+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
248246 uint16_t len )
249247{
250248#if defined(NUCLEO_F411RE )
251249 HAL_I2C_Mem_Write (handle , LSM6DS3TR_C_I2C_ADD_L , reg ,
252- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
250+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
253251#elif defined(STEVAL_MKI109V3 )
254252 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
255253 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
256- HAL_SPI_Transmit (handle , bufp , len , 1000 );
254+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
257255 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
258256#elif defined(SPC584B_DIS )
259- i2c_lld_write (handle , LSM6DS3TR_C_I2C_ADD_L & 0xFE , reg , bufp , len );
257+ i2c_lld_write (handle , LSM6DS3TR_C_I2C_ADD_L & 0xFE , reg ,
258+ (uint8_t * ) bufp , len );
260259#endif
261260 return 0 ;
262261}
0 commit comments