diff options
Diffstat (limited to 'src/i2c.c')
-rw-r--r-- | src/i2c.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |