aboutsummaryrefslogtreecommitdiff
path: root/i2c.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2014-09-23 17:24:57 +0200
committerLars-Dominik Braun <lars@6xq.net>2014-09-30 15:15:01 +0200
commit6708da2661d693f855b6f56d69af1e2fb8502463 (patch)
tree5b8eac0f6f40932417519cbdcd229caeabd8eee8 /i2c.c
parent69cb10f51321a2443a3314c40fb2b8556aa804c0 (diff)
downloadhourglass-6708da2661d693f855b6f56d69af1e2fb8502463.tar.gz
hourglass-6708da2661d693f855b6f56d69af1e2fb8502463.tar.bz2
hourglass-6708da2661d693f855b6f56d69af1e2fb8502463.zip
Add wakeup source mechanism
Should reduce amount of cpu wakeups with expensive computations.
Diffstat (limited to 'i2c.c')
-rw-r--r--i2c.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/i2c.c b/i2c.c
index 00dee14..a94b3a0 100644
--- a/i2c.c
+++ b/i2c.c
@@ -255,5 +255,8 @@ ISR(TWI_vect) {
assert (0 && "nope\n");
break;
}
+ if (twr.status == TWST_ERR || twr.status == TWST_OK) {
+ enableWakeup (WAKE_I2C);
+ }
}