From: asterix Date: Fri, 23 Jul 2010 16:46:29 +0000 (+0000) Subject: Add test stop and generic error. X-Git-Tag: 2.6.0~288^2~34 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ddf9d16279441b51120aa9965ae488f75ef6f1a4;p=bertos.git Add test stop and generic error. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4060 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/i2c.h b/bertos/drv/i2c.h index 1a0dbffe..eea0073a 100644 --- a/bertos/drv/i2c.h +++ b/bertos/drv/i2c.h @@ -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;