diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-02-10 13:13:26 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-02-10 13:13:26 +0100 |
commit | dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290 (patch) | |
tree | f37650f5f1d0c35f8f1036f52c647d3a424036cb /gyro.c | |
parent | f76febc83d304119f90b2faf7c1f275292c968f7 (diff) | |
download | hourglass-dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290.tar.gz hourglass-dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290.tar.bz2 hourglass-dd81f8691752b3e4cdfb2b0fc43eb336aa9d4290.zip |
accel: Nonblocking
Diffstat (limited to 'gyro.c')
-rw-r--r-- | gyro.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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; } |