aboutsummaryrefslogtreecommitdiff
path: root/gyro.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2014-07-29 16:16:35 +0200
committerLars-Dominik Braun <lars@6xq.net>2014-07-29 16:16:35 +0200
commitf76d64e8db03c56c45afbbb60da801d7a801d460 (patch)
treeb0f00b5af319333ed303becc377e86117fb9335c /gyro.c
parentc6f7452ab86675465959b5f8784e3140438a56ba (diff)
downloadhourglass-f76d64e8db03c56c45afbbb60da801d7a801d460.tar.gz
hourglass-f76d64e8db03c56c45afbbb60da801d7a801d460.tar.bz2
hourglass-f76d64e8db03c56c45afbbb60da801d7a801d460.zip
i2c: Make sure status is _OK
Not sure if this fixes anything.
Diffstat (limited to 'gyro.c')
-rw-r--r--gyro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gyro.c b/gyro.c
index 35ec76b..f31385d 100644
--- a/gyro.c
+++ b/gyro.c
@@ -99,7 +99,7 @@ bool gyroProcess () {
reading = false;
}
} else {
- if (((PINB >> PINB1) & 0x1) && twr.status != TWST_WAIT) {
+ if (((PINB >> PINB1) & 0x1) && twr.status == TWST_OK) {
/* new data available in device buffer and bus is free */
if (!twRequest (TWM_READ, L3GD20, L3GD20_OUTZ,
(uint8_t *) &zval, sizeof (zval))) {