@@ -96,8 +96,7 @@ static uint8_t tx_buffer[1000];
9696 * and are strictly related to the hardware platform used.
9797 *
9898 */
99- static int32_t platform_write (void * handle , uint8_t reg ,
100- uint8_t * bufp ,
99+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
101100 uint16_t len );
102101static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
103102 uint16_t len );
@@ -166,15 +165,15 @@ void stts751_read_data_polling(void)
166165 * @param len number of consecutive register to write
167166 *
168167 */
169- static int32_t platform_write (void * handle , uint8_t reg ,
170- uint8_t * bufp ,
168+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
171169 uint16_t len )
172170{
173171#if defined(NUCLEO_F411RE )
174172 HAL_I2C_Mem_Write (handle , STTS751_0xxxx_ADD_7K5 , reg ,
175- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
173+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
176174#elif defined(SPC584B_DIS )
177- i2c_lld_write (handle , STTS751_0xxxx_ADD_7K5 & 0xFE , reg , bufp , len );
175+ i2c_lld_write (handle , STTS751_0xxxx_ADD_7K5 & 0xFE , reg ,
176+ (uint8_t * ) bufp , len );
178177#endif
179178 return 0 ;
180179}
0 commit comments