aboutsummaryrefslogtreecommitdiff
path: root/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'i2c.c')
-rw-r--r--i2c.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/i2c.c b/i2c.c
index 7855e88..3e4bffb 100644
--- a/i2c.c
+++ b/i2c.c
@@ -1,6 +1,8 @@
#include <stdio.h>
#include <util/twi.h>
#include <avr/interrupt.h>
+#include <stdlib.h>
+#include <assert.h>
#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;