aboutsummaryrefslogtreecommitdiff
path: root/accel.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-01-13 13:18:48 +0100
committerLars-Dominik Braun <lars@6xq.net>2015-01-13 13:18:48 +0100
commite748efd36ae4fb41f24baa4cc79d674dba2a8c3f (patch)
treef2425e5dc1aff9f8874da55941de0dbfe436c1c6 /accel.c
parentebc6f6a6cf20a25c0dd2cefaa9c86285509a3407 (diff)
downloadhourglass-e748efd36ae4fb41f24baa4cc79d674dba2a8c3f.tar.gz
hourglass-e748efd36ae4fb41f24baa4cc79d674dba2a8c3f.tar.bz2
hourglass-e748efd36ae4fb41f24baa4cc79d674dba2a8c3f.zip
Remove debugging puts/fwrite
We’re tight on SRAM and the stack seems overflow from time to time. Removing the strings should give us some breathing room.
Diffstat (limited to 'accel.c')
-rw-r--r--accel.c8
1 files changed, 3 insertions, 5 deletions
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;