From 92ec11b505a5b68c33e6158dbc68cea1d23cbd35 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 10 Feb 2015 12:33:58 +0100 Subject: Reduce CPU frequency Also reduces PWM frequency. The speakers resonance frequency is 2kHz, with 1MHz clock speed and prescaler 256 we get pretty close. --- gyro.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'gyro.c') diff --git a/gyro.c b/gyro.c index 3079c20..5b32314 100644 --- a/gyro.c +++ b/gyro.c @@ -136,16 +136,15 @@ bool gyroProcess () { if (shouldWakeup (WAKE_I2C)) { disableWakeup (WAKE_I2C); state = IDLE; - assert (twr.status != TWST_ERR); - if (twr.status == TWST_OK) { - /* new data transfered, process it */ - /* poor man's noise filter */ - if (abs (zval) > 64) { - zaccum += zval; - } - gyroProcessTicks (); - return true; + /* the bus might be in use again already */ + //assert (twr.status == TWST_OK); + /* new data transfered, process it */ + /* poor man's noise filter */ + if (abs (zval) > 64) { + zaccum += zval; } + gyroProcessTicks (); + return true; } break; -- cgit v1.2.3