diff options
author | Brett Weiland <brett_weiland@bpcsapce.com> | 2023-01-12 13:41:48 -0600 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcsapce.com> | 2023-01-12 13:41:48 -0600 |
commit | b666668d0e6b67e4632e65486cae814ab5abbc39 (patch) | |
tree | 0cf0c2d689799c5e98d505e632248fdc5ed5a072 /src/i2c.c | |
parent | 94304b11e7220f060dbc345de5fa1952d0465016 (diff) |
updating for linkedin
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 |