mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 17:06:31 +08:00
[peripherals] ignore cast-qual for mpu9250 as well
This commit is contained in:
@@ -114,8 +114,15 @@ void mpu9250_i2c_event(struct Mpu9250_I2c *mpu)
|
||||
mpu->data_rates.rates.r = Int16FromBuf(mpu->i2c_trans.buf, 13);
|
||||
|
||||
// if we are reading slaves through the mpu, copy the ext_sens_data
|
||||
if ((mpu->config.i2c_bypass == FALSE) && (mpu->config.nb_slaves > 0))
|
||||
memcpy(mpu->data_ext, (void *) &(mpu->i2c_trans.buf[15]), mpu->config.nb_bytes - 15);
|
||||
if ((mpu->config.i2c_bypass == FALSE) && (mpu->config.nb_slaves > 0)) {
|
||||
/* the buffer is volatile, since filled from ISR
|
||||
* but we know it's ok to use it here so we silence the warning
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
memcpy(mpu->data_ext, (uint8_t *) &(mpu->i2c_trans.buf[15]), mpu->config.nb_bytes - 15);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
mpu->data_available = TRUE;
|
||||
}
|
||||
|
||||
@@ -114,8 +114,15 @@ void mpu9250_spi_event(struct Mpu9250_Spi *mpu)
|
||||
mpu->data_rates.rates.r = Int16FromBuf(mpu->rx_buf, 14);
|
||||
|
||||
// if we are reading slaves, copy the ext_sens_data
|
||||
if (mpu->config.nb_slaves > 0)
|
||||
memcpy(mpu->data_ext, (void *) &(mpu->rx_buf[16]), mpu->config.nb_bytes - 15);
|
||||
if (mpu->config.nb_slaves > 0) {
|
||||
/* the buffer is volatile, since filled from ISR
|
||||
* but we know it's ok to use it here so we silence the warning
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
memcpy(mpu->data_ext, (uint8_t *) &(mpu->rx_buf[16]), mpu->config.nb_bytes - 15);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
mpu->data_available = TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user