From ddf9d16279441b51120aa9965ae488f75ef6f1a4 Mon Sep 17 00:00:00 2001 From: asterix Date: Fri, 23 Jul 2010 16:46:29 +0000 Subject: [PATCH] Add test stop and generic error. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4060 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/i2c.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.25.1