mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 01:53:48 +08:00
[omap] i2c: disable some warnings and fix dox
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file arch/omap/mcu_periph/i2c_arch.h
|
/** @file arch/omap/mcu_periph/i2c_arch.c
|
||||||
* I2C functionality
|
* I2C functionality
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -53,6 +53,9 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
|
|||||||
// Set the slave address
|
// Set the slave address
|
||||||
ioctl(file, I2C_SLAVE, t->slave_addr);
|
ioctl(file, I2C_SLAVE, t->slave_addr);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||||
|
|
||||||
// Switch the different transaction types
|
// Switch the different transaction types
|
||||||
switch (t->type) {
|
switch (t->type) {
|
||||||
// Just transmitting
|
// Just transmitting
|
||||||
@@ -71,7 +74,8 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
|
|||||||
break;
|
break;
|
||||||
// First Transmit and then read
|
// First Transmit and then read
|
||||||
case I2CTransTxRx:
|
case I2CTransTxRx:
|
||||||
if (write(file, (uint8_t *)t->buf, t->len_w) < 0 || read(file, (uint8_t *)t->buf, t->len_r) < 0) {
|
if (write(file, (uint8_t *)t->buf, t->len_w) < 0 ||
|
||||||
|
read(file, (uint8_t *)t->buf, t->len_r) < 0) {
|
||||||
t->status = I2CTransFailed;
|
t->status = I2CTransFailed;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -80,6 +84,8 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
// Successfull transfer
|
// Successfull transfer
|
||||||
t->status = I2CTransSuccess;
|
t->status = I2CTransSuccess;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
/* $Id: i2c-dev.h 5361 2008-10-19 09:47:02Z khali $ */
|
/* $Id: i2c-dev.h 5361 2008-10-19 09:47:02Z khali $ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file boards/ardrone/i2c-dev.h
|
* @file arch/omap/mcu_periph/i2c_smbus.h
|
||||||
* I2C-bus driver
|
* I2C-bus driver
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user