aboutsummaryrefslogtreecommitdiff
path: root/gyro.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-02-10 13:13:26 +0100
committerLars-Dominik Braun <lars@6xq.net>2015-02-10 13:13:26 +0100
commitdd81f8691752b3e4cdfb2b0fc43eb336aa9d4290 (patch)
treef37650f5f1d0c35f8f1036f52c647d3a424036cb /gyro.c
parentf76febc83d304119f90b2faf7c1f275292c968f7 (diff)
downloadhourglass-dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290.tar.gz
hourglass-dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290.tar.bz2
hourglass-dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290.zip
accel: Nonblocking
Diffstat (limited to 'gyro.c')
-rw-r--r--gyro.c8
1 files changed, 3 insertions, 5 deletions
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;
}