From af04ae1b8010a5901f9299425ed3c1bdac4ba766 Mon Sep 17 00:00:00 2001 From: batt Date: Mon, 6 Oct 2008 17:22:03 +0000 Subject: [PATCH] Merged from external project: ********** r22419 | batt | 2008-10-03 15:25:13 +0200 (Fri, 03 Oct 2008) | 1 line Add missing headers; Add ASSERT to check sync on start; add modcheck for timer. ********** git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1880 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/i2c_bitbang.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bertos/drv/i2c_bitbang.c b/bertos/drv/i2c_bitbang.c index 71374e98..1b7b7878 100644 --- a/bertos/drv/i2c_bitbang.c +++ b/bertos/drv/i2c_bitbang.c @@ -43,8 +43,12 @@ #define LOG_FORMAT I2C_LOG_FORMAT #include +#include #include +#include +#include + #include "hw/hw_i2c_bitbang.h" INLINE bool i2c_start(void) @@ -54,6 +58,7 @@ INLINE bool i2c_start(void) I2C_HALFBIT_DELAY(); SDA_LO; I2C_HALFBIT_DELAY(); + ASSERT(!SDA_IN); return !SDA_IN; } @@ -166,6 +171,7 @@ MOD_DEFINE(i2c); */ void i2c_init(void) { + MOD_CHECK(timer); I2C_BITBANG_HW_INIT; SDA_HI; SCL_HI; -- 2.25.1