From dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 10 Feb 2015 13:13:26 +0100 Subject: accel: Nonblocking --- gyro.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gyro.c') diff --git a/gyro.c b/gyro.c index 5b32314..cfadebf 100644 --- a/gyro.c +++ b/gyro.c @@ -149,11 +149,9 @@ bool gyroProcess () { break; case IDLE: - if (shouldWakeup (WAKE_GYRO) && twr.status == TWST_OK) { - /* new data available in device buffer and bus is free */ - const bool ret = twRequest (TWM_READ, L3GD20, L3GD20_OUTZ, - (uint8_t *) &zval, sizeof (zval)); - assert (ret); + /* new data available in device buffer and bus is free */ + if (shouldWakeup (WAKE_GYRO) && twRequest (TWM_READ, L3GD20, + L3GD20_OUTZ, (uint8_t *) &zval, sizeof (zval))) { /* wakeup source is disabled by isr to prevent race condition */ state = READING; } -- cgit v1.2.3