From e748efd36ae4fb41f24baa4cc79d674dba2a8c3f Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 13 Jan 2015 13:18:48 +0100 Subject: Remove debugging puts/fwrite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re tight on SRAM and the stack seems overflow from time to time. Removing the strings should give us some breathing room. --- accel.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'accel.c') diff --git a/accel.c b/accel.c index 350bf9f..152346a 100644 --- a/accel.c +++ b/accel.c @@ -85,11 +85,10 @@ void accelStart () { if (!twRequest (TWM_WRITE, LIS302DL, LIS302DL_CTRLREG1, data, sizeof (data)/sizeof (*data))) { - puts ("cannot start write"); + assert (0); } sleepwhile (twr.status == TWST_WAIT); assert (twr.status == TWST_OK); - puts ("accelStart done"); disableWakeup (WAKE_I2C); } @@ -166,15 +165,14 @@ bool accelProcess () { /* new data transfered */ return true; } else if (twr.status == TWST_ERR) { - puts ("accel i2c error: "); - fwrite ((void *) &twr.error, sizeof (twr.error), 1, stdout); + assert (0); } } else { if (shouldWakeup (WAKE_ACCEL) && twr.status == TWST_OK) { /* new data available in device buffer and bus is free */ if (!twRequest (TWM_READ, LIS302DL, LIS302DL_OUTZ, (uint8_t *) &zval, sizeof (zval))) { - puts ("cannot start read"); + assert (0); } else { /* wakeup source is disabled by isr to prevent race condition */ reading = true; -- cgit v1.2.3