Add test stop and generic error.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Jul 2010 16:46:29 +0000 (16:46 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Jul 2010 16:46:29 +0000 (16:46 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4060 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/i2c.h

index 1a0dbffedc64067e0af9600e2ccaad0ed939344b..eea0073a1dd016859485fbbea077a4c0f6eb710c 100644 (file)
@@ -184,7 +184,9 @@ INLINE void i2c_start(I2c *i2c, uint16_t slave_addr, size_t size)
 {
        ASSERT(i2c->vt);
        ASSERT(i2c->vt->start);
-       ASSERT(i2c->xfer_size == 0);
+
+       if (!i2c->errors)
+               ASSERT(i2c->xfer_size == 0);
 
        i2c->errors = 0;
        i2c->xfer_size = size;