mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 20:38:27 +08:00
[arch/linux] GCC diagnostic pragma outside of i2c_submit function
gives errors with codesourcery 2009q1 203 build toolchain: error: #pragma GCC diagnostic not allowed inside functions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user