From af0e40079ded13b8842e8d129fa6ed2f37fdf678 Mon Sep 17 00:00:00 2001 From: barthess Date: Fri, 1 Jul 2011 13:36:59 +0000 Subject: I2C. Trying to add optional WAIT support. Driver broken. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3101 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/i2c.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'os/hal/include') diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index 60b2c322d..0a4ba8b53 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -165,9 +165,9 @@ struct I2CSlaveConfig{ * @notapi */ #define _i2c_wait_s(i2cp) { \ - chDbgAssert((i2cp)->thread == NULL, \ + chDbgAssert((i2cp)->id_thread == NULL, \ "_i2c_wait(), #1", "already waiting"); \ - (i2cp)->thread = chThdSelf(); \ + (i2cp)->id_thread = chThdSelf(); \ chSchGoSleepS(THD_STATE_SUSPENDED); \ } @@ -179,9 +179,9 @@ struct I2CSlaveConfig{ * @notapi */ #define _i2c_wakeup_isr(i2cp) { \ - if ((i2cp)->thread != NULL) { \ - Thread *tp = (i2cp)->thread; \ - (i2cp)->thread = NULL; \ + if ((i2cp)->id_thread != NULL) { \ + Thread *tp = (i2cp)->id_thread; \ + (i2cp)->id_thread = NULL; \ chSysLockFromIsr(); \ chSchReadyI(tp); \ chSysUnlockFromIsr(); \ @@ -216,7 +216,6 @@ struct I2CSlaveConfig{ else \ (i2cp)->id_state = I2C_READY; \ _i2c_wakeup_isr(i2cp); \ - i2cReleaseBus(i2cp); \ } -- cgit v1.2.3