From b666668d0e6b67e4632e65486cae814ab5abbc39 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Thu, 12 Jan 2023 13:41:48 -0600 Subject: updating for linkedin --- src/i2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/i2c.c') 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 -- cgit v1.2.3