Skip to content

Commit

Permalink
One more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokechu22 committed Jan 14, 2024
1 parent 7a93ac7 commit a175779
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Core/Common/I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ int I2CBusSimple::BusRead(u8 slave_addr, u8 addr, int count, u8* data_out)
// Note: No Stop() call before StartRead.
if (!StartRead(slave_addr))
{
WARN_LOG_FMT(WII_IPC, "I2C: Failed to start read from {:02x} ({:02x}, {:02x})",
slave_addr, addr, count);
WARN_LOG_FMT(WII_IPC, "I2C: Failed to start read from {:02x} ({:02x}, {:02x})", slave_addr,
addr, count);
Stop();
return 0;
}
Expand Down Expand Up @@ -479,7 +479,9 @@ bool I2CSlaveAutoIncrementing::WriteByte(u8 value)
{
if (m_device_address.has_value())
{
WriteByte(m_device_address.value(), value);
const u8 cur_addr = m_device_address.value();
m_device_address = cur_addr + 1; // wrapping from 255 to 0 is the assumed behavior
WriteByte(cur_addr, value);
}
else
{
Expand Down

0 comments on commit a175779

Please sign in to comment.