Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatth11 committed Nov 26, 2024
1 parent 298462f commit 3247069
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ MCU=attiny85
# TARGET_PLATFORM=m328p
# for attiny85
TARGET_PLATFORM=t85
USB_PORT=usb:001:013
USB_PORT=usb:001:006

LD_FLAGS=-DF_CPU=$(CLOCK_FREQ)

Expand Down
4 changes: 2 additions & 2 deletions src/driver/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool i2c_start() {
// ensure both lines are high
i2c_port |= (_BV(i2c_sda) | _BV(i2c_scl));
// wait till clock pin is high
while (!(i2c_pin & _BV(i2c_scl)));
while (!(i2c_port & _BV(i2c_scl)));
_delay_us(T2_TWI);

// pull data line low
Expand Down Expand Up @@ -104,7 +104,7 @@ unsigned char transfer(unsigned char mask) {
// wait short
_delay_us(T4_TWI);
// toggle clock again
i2c_control = _BV(USITC);
i2c_control |= _BV(USITC);

} while (!(i2c_status & _BV(USIOIF)));
_delay_us(T2_TWI);
Expand Down

0 comments on commit 3247069

Please sign in to comment.