diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-31 10:34:04 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-31 10:34:04 +0000 |
commit | 409fb83520d52bdf62baedfe639d8704f50bb5b1 (patch) | |
tree | 8d3e1b4a585e144fe8fb33e1dfb1ba5557ed92e3 /testhal/STM32F1xx/I2C/fake.c | |
parent | c397738010966f85c7ae841e21d74790ac49611c (diff) | |
download | ChibiOS-409fb83520d52bdf62baedfe639d8704f50bb5b1.tar.gz ChibiOS-409fb83520d52bdf62baedfe639d8704f50bb5b1.tar.bz2 ChibiOS-409fb83520d52bdf62baedfe639d8704f50bb5b1.zip |
I2C. Fully functional testhal for STM32F1x.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3696 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F1xx/I2C/fake.c')
-rw-r--r-- | testhal/STM32F1xx/I2C/fake.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/testhal/STM32F1xx/I2C/fake.c b/testhal/STM32F1xx/I2C/fake.c index 9d46f448d..35cd54f62 100644 --- a/testhal/STM32F1xx/I2C/fake.c +++ b/testhal/STM32F1xx/I2C/fake.c @@ -49,8 +49,12 @@ void request_fake(void){ status = i2cMasterReceiveTimeout(&I2CD1, addr, rx_data, 2, tmo);
i2cReleaseBus(&I2CD1);
- if (status != RDY_OK){
+ if (status == RDY_RESET){
errors = i2cGetErrors(&I2CD1);
+ if (errors == I2CD_ACK_FAILURE){
+ /* there is no slave with given address on the bus, or it was die */
+ return;
+ }
}
else{
|