@@ -111,8 +111,7 @@ static uint8_t tx_buffer[1000];
111111 * Functions declare in this section are defined at the end of this file
112112 * and are strictly related to the hardware platform used.
113113 */
114- static int32_t platform_write (void * handle , uint8_t reg ,
115- uint8_t * bufp ,
114+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
116115 uint16_t len );
117116static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
118117 uint16_t len );
@@ -218,20 +217,19 @@ void lsm6dso32_read_data_polling(void)
218217 * @param len number of consecutive register to write
219218 *
220219 */
221- static int32_t platform_write (void * handle , uint8_t reg ,
222- uint8_t * bufp ,
220+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
223221 uint16_t len )
224222{
225223#if defined(NUCLEO_F411RE )
226224 HAL_I2C_Mem_Write (handle , LSM6DSO32_I2C_ADD_H , reg ,
227- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
225+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
228226#elif defined(STEVAL_MKI109V3 )
229227 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
230228 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
231- HAL_SPI_Transmit (handle , bufp , len , 1000 );
229+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
232230 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
233231#elif defined(SPC584B_DIS )
234- i2c_lld_write (handle , LSM6DSO32_I2C_ADD_H & 0xFE , reg , bufp , len );
232+ i2c_lld_write (handle , LSM6DSO32_I2C_ADD_H & 0xFE , reg , ( uint8_t * ) bufp , len );
235233#endif
236234 return 0 ;
237235}
0 commit comments