diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-05-06 15:16:15 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-05-06 15:16:15 +0000 |
commit | 60975ca7fed0e2960bced2fe72239422f8376068 (patch) | |
tree | 116f496bf509daccf541b8a10fc32d5dc49681a9 /os/hal/src/i2c.c | |
parent | 4fda4dc84fcfcfa483f10a8b5043d124ad551ba0 (diff) | |
download | ChibiOS-60975ca7fed0e2960bced2fe72239422f8376068.tar.gz ChibiOS-60975ca7fed0e2960bced2fe72239422f8376068.tar.bz2 ChibiOS-60975ca7fed0e2960bced2fe72239422f8376068.zip |
I2C. Some fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@2922 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/i2c.c')
-rw-r--r-- | os/hal/src/i2c.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index 50767b3a9..1a2873a29 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -140,11 +140,14 @@ void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) { size_t n;
i2cblock_t *txbuf;
+ uint8_t nbit_addr;
txbuf = i2cscfg->txbuf;
+ nbit_addr = i2cscfg->nbit_address;
n = i2cscfg->tx_remaining_bytes;
- chDbgCheck((i2cp != NULL) && (i2cscfg != NULL) && (n > 0) && (txbuf != NULL),
+ chDbgCheck((i2cp != NULL) && (i2cscfg != NULL) && \
+ ((nbit_addr == 7) || (nbit_addr == 10)) && (n > 0) && (txbuf != NULL),
"i2cMasterTransmit");
// init slave config field in driver
@@ -186,11 +189,14 @@ void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg){ size_t n;
i2cblock_t *rxbuf;
+ uint8_t nbit_addr;
rxbuf = i2cscfg->rxbuf;
n = i2cscfg->rx_remaining_bytes;
+ nbit_addr = i2cscfg->nbit_address;
- chDbgCheck((i2cp != NULL) && (n > 0) && (rxbuf != NULL),
+ chDbgCheck((i2cp != NULL) && (i2cscfg != NULL) && (n > 0) && \
+ ((nbit_addr == 7) || (nbit_addr == 10)) && (rxbuf != NULL),
"i2cMasterReceive");
// init slave config field in driver
@@ -221,6 +227,7 @@ void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg){ chSysUnlock();
}
+
uint16_t i2cSMBusAlertResponse(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
i2cMasterReceive(i2cp, i2cscfg);
|