From b05df9df58bc6fdd122abfec3012bc2537fc069c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 22 Apr 2014 16:48:50 +0200 Subject: Fix interrupt stuff Sorta polling based now, with interrupts used to wake up from sleep only. At least it works. --- i2c.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'i2c.c') diff --git a/i2c.c b/i2c.c index 7855e88..3e4bffb 100644 --- a/i2c.c +++ b/i2c.c @@ -1,6 +1,8 @@ #include #include #include +#include +#include #include "i2c.h" #include "common.h" @@ -67,10 +69,7 @@ void twInit () { */ bool twRequest (const twMode mode, const uint8_t address, const uint8_t subaddress, uint8_t * const data, const uint8_t count) { - /* do not start if request is pending */ - if (twr.status == TWST_WAIT) { - return false; - } + assert (twr.status != TWST_WAIT); twr.mode = mode; twr.address = address; -- cgit v1.2.3