diff --git a/sw/airborne/arch/linux/mcu_periph/i2c_arch.c b/sw/airborne/arch/linux/mcu_periph/i2c_arch.c index a56cd0414d..21e171d742 100644 --- a/sw/airborne/arch/linux/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/linux/mcu_periph/i2c_arch.c @@ -46,6 +46,8 @@ bool_t i2c_idle(struct i2c_periph *p __attribute__((unused))) return TRUE; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t) { int file = (int)p->reg_addr; @@ -53,9 +55,6 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t) // Set the slave address ioctl(file, I2C_SLAVE, t->slave_addr); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" - // Switch the different transaction types switch (t->type) { // Just transmitting @@ -84,12 +83,12 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t) break; } -#pragma GCC diagnostic pop - // Successfull transfer t->status = I2CTransSuccess; return TRUE; } +#pragma GCC diagnostic pop + #if USE_I2C0 struct i2c_errors i2c0_errors;