From f76d64e8db03c56c45afbbb60da801d7a801d460 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 29 Jul 2014 16:16:35 +0200 Subject: i2c: Make sure status is _OK Not sure if this fixes anything. --- accel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'accel.c') diff --git a/accel.c b/accel.c index 127cc0f..bd73043 100644 --- a/accel.c +++ b/accel.c @@ -167,7 +167,7 @@ bool accelProcess () { reading = false; } } else { - if (!((PINC >> PINC1) & 0x1) && twr.status != TWST_WAIT) { + if (!((PINC >> PINC1) & 0x1) && twr.status == TWST_OK) { /* new data available in device buffer and bus is free */ if (!twRequest (TWM_READ, LIS302DL, LIS302DL_OUTZ, (uint8_t *) &zval, sizeof (zval))) { -- cgit v1.2.3