summaryrefslogtreecommitdiff
path: root/src/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/i2c.c')
-rw-r--r--src/i2c.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/i2c.c b/src/i2c.c
index 0b1cb90..6259095 100644
--- a/src/i2c.c
+++ b/src/i2c.c
@@ -37,7 +37,7 @@
*
*/
-void error() { }
+void error() { debug_crash(); }
void i2c_init() {
TWBR = 12;
@@ -61,7 +61,7 @@ void i2c_start(uint8_t addr, bool rw) {
loop_until_bit_is_set(TWCR, TWINT);
if(((TWSR & 0xf8) != (TW_MT_SLA_ACK)) && (TWSR & 0xf8) != (TW_MR_SLA_ACK)) {
- #ifdef DEBUG_BUILD
+ #if DEBUG_BUILD
printf("unhandled NACK in address transmission\
TWCR: 0x%x\
TWSR: 0x%x\r\n", TWCR, (TWSR & ~(0b11)));
@@ -71,7 +71,7 @@ void i2c_start(uint8_t addr, bool rw) {
}
-void i2c_stop() { TWCR = (_BV(TWSTO) | _BV(TWEN) | _BV(TWINT)); _delay_ms(500); }
+void i2c_stop() { TWCR = (_BV(TWSTO) | _BV(TWEN) | _BV(TWINT)); }
void i2c_send(uint8_t byte) {
TWDR = byte; //fist packet is address